5 changed files with 0 additions and 157 deletions
-
18src/main/java/a8k/service/appdb/dao/AppUsrDao.java
-
17src/main/java/a8k/service/appdb/entity/AppSettingIterm.java
-
37src/main/java/a8k/service/appdb/entity/AppUsr.java
-
9src/main/java/a8k/service/data_service/AppSettingService.java
-
76src/main/java/a8k/service/data_service/UsrMgrService.java
@ -1,18 +0,0 @@ |
|||
package a8k.service.appdb.dao; |
|||
|
|||
import a8k.service.appdb.entity.AppUsr; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
@Component |
|||
public class AppUsrDao { |
|||
List<AppUsr> getAllUsr() { |
|||
return null; |
|||
} |
|||
|
|||
AppUsr getAppUsr() { |
|||
return null; |
|||
} |
|||
} |
@ -1,17 +0,0 @@ |
|||
package a8k.service.appdb.entity; |
|||
import com.iflytop.uf.UfActiveRecordField; |
|||
|
|||
public class AppSettingIterm { |
|||
@UfActiveRecordField |
|||
public String key; |
|||
@UfActiveRecordField |
|||
public String serviceName; //常量"AppSetting" |
|||
@UfActiveRecordField |
|||
public String valType; |
|||
@UfActiveRecordField |
|||
public String val; |
|||
|
|||
public static String getTableName() { |
|||
return "AppSettingIterm" + "Table"; |
|||
} |
|||
} |
@ -1,37 +0,0 @@ |
|||
package a8k.service.appdb.entity; |
|||
|
|||
import com.iflytop.uf.UfActiveRecordField; |
|||
|
|||
public class AppUsr { |
|||
|
|||
/* |
|||
* |
|||
* 内置用户有两个 |
|||
* admin |
|||
* |
|||
* |
|||
* isMgr: |
|||
* 可以删除其他用户 |
|||
* 允许打开设备调试页面,用户通过电脑访问设备调试网页,需要登录,且此时只有isMgr用户可以登录。 |
|||
* |
|||
*/ |
|||
|
|||
@UfActiveRecordField |
|||
public String name; |
|||
|
|||
@UfActiveRecordField |
|||
public String passwd; |
|||
|
|||
@UfActiveRecordField |
|||
public Boolean builtInSser; //如果为true,该用户不允许被删除,不允许被修改名字 |
|||
|
|||
@UfActiveRecordField |
|||
public Boolean isMgr; //如果为true, 该用户为管理员权限 |
|||
|
|||
@UfActiveRecordField |
|||
public Boolean isDisplay; //是否显示在前端 |
|||
|
|||
public static String getTableName() { |
|||
return "AppUsr" + "Table"; |
|||
} |
|||
} |
@ -1,9 +0,0 @@ |
|||
package a8k.service.data_service; |
|||
|
|||
import org.springframework.stereotype.Component; |
|||
|
|||
@Component |
|||
public class AppSettingService { |
|||
|
|||
|
|||
} |
@ -1,76 +0,0 @@ |
|||
package a8k.service.data_service; |
|||
|
|||
import a8k.service.hardware.canbus.protocol.A8kEcode; |
|||
import a8k.service.appdb.dao.AppUsrDao; |
|||
import a8k.service.appdb.entity.AppUsr; |
|||
import a8k.service.state_service.A8kStateMgrService; |
|||
import jakarta.annotation.Resource; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Component |
|||
public class UsrMgrService { |
|||
|
|||
|
|||
static final int LOGIN_TYPE_APP = 1; //正常页面,用户登录 |
|||
static final int LOGIN_TYPE_DEBUG_PAGE = 2; //调试页面,用户登录 |
|||
|
|||
@Resource |
|||
AppUsrDao appUsrDao; |
|||
|
|||
@Resource |
|||
A8kStateMgrService state; |
|||
|
|||
/* |
|||
* 数据库更删改查 |
|||
*/ |
|||
|
|||
//TODO |
|||
public List<AppUsr> getUsr() { |
|||
return null; |
|||
} |
|||
|
|||
//TODO |
|||
public A8kEcode addUsr(AppUsr usr) { |
|||
return A8kEcode.Success; |
|||
} |
|||
|
|||
//TODO |
|||
public A8kEcode updateUsr(String uname, String passwd) { |
|||
return A8kEcode.Success; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* |
|||
* @param loginType 登录类型 LOGIN_TYPE_APP,LOGIN_TYPE_DEBUG_PAGE |
|||
* @param uname 用户名称 |
|||
* @param passwd 密码 |
|||
* @return Success or PasswdError or UserDoesNotExist |
|||
* |
|||
* |
|||
*/ |
|||
public A8kEcode verifyAndLoginAppUsr(Integer loginType, String uname, String passwd) { |
|||
/* |
|||
*TODO |
|||
* 实现描述: |
|||
* 1. 校验成功,则调用A8kStateMgrService.loginAppUsr 或者 A8kStateMgrService.loginDebugPageUsr |
|||
*/ |
|||
return A8kEcode.UserDoesNotExist; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* @param loginType 登录类型 LOGIN_TYPE_APP,LOGIN_TYPE_DEBUG_PAGE |
|||
*/ |
|||
public void unloginAppUsr(Integer loginType) { |
|||
if (loginType == LOGIN_TYPE_APP) { |
|||
state.unloginAppUsr(); |
|||
} else if (loginType == LOGIN_TYPE_DEBUG_PAGE) { |
|||
state.unloginAppUsr(); |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue