Ver Fonte

update api

deason há 1 ano atrás
pai
commit
5dc489c455

+ 20 - 0
src/main/java/com/qmth/exam/reserve/bean/SystemPropertyBean.java

@@ -0,0 +1,20 @@
+package com.qmth.exam.reserve.bean;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class SystemPropertyBean {
+
+    @ApiModelProperty(value = "文件访问前缀")
+    private String fileUrlPrefix;
+
+    @ApiModelProperty(value = "当前学校名称")
+    private String orgTitle;
+
+    @ApiModelProperty(value = "分类层级别名集合")
+    private String categoryLevels;
+
+}

+ 20 - 0
src/main/java/com/qmth/exam/reserve/bean/login/LoginReq.java

@@ -0,0 +1,20 @@
+package com.qmth.exam.reserve.bean.login;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class LoginReq {
+
+    @ApiModelProperty(value = "学校ID(选填)")
+    private Long orgId;
+
+    @ApiModelProperty(value = "账号", required = true)
+    private String account;
+
+    @ApiModelProperty(value = "密码", required = true)
+    private String password;
+
+}

+ 23 - 0
src/main/java/com/qmth/exam/reserve/bean/login/SessionUser.java

@@ -0,0 +1,23 @@
+package com.qmth.exam.reserve.bean.login;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class SessionUser {
+
+    @ApiModelProperty(value = "学校ID")
+    private Long orgId;
+
+    @ApiModelProperty(value = "用户ID")
+    private Long id;
+
+    @ApiModelProperty(value = "用户姓名")
+    private String name;
+
+    @ApiModelProperty(value = "鉴权信息")
+    private String token;
+
+}

+ 31 - 0
src/main/java/com/qmth/exam/reserve/controller/admin/SystemPropertyController.java

@@ -0,0 +1,31 @@
+package com.qmth.exam.reserve.controller.admin;
+
+import com.qmth.boot.api.annotation.Aac;
+import com.qmth.boot.api.constant.ApiConstant;
+import com.qmth.exam.reserve.bean.SystemPropertyBean;
+import com.qmth.exam.reserve.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@Api(tags = "系统常用属性相关接口")
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/system")
+@Aac(strict = false, auth = false)
+public class SystemPropertyController extends BaseController {
+
+    @ApiOperation(value = "获取系统常用属性集合")
+    @PostMapping(value = "/properties")
+    public SystemPropertyBean properties() {
+        SystemPropertyBean properties = new SystemPropertyBean();
+        properties.setFileUrlPrefix("https://xxx.com");
+        properties.setOrgTitle("XXX大学");
+        properties.setCategoryLevels("[{\"level\":1,\"title\":\"城市\"},{\"level\":2,\"title\":\"教学点\"}]");
+        // todo
+
+        return properties;
+    }
+
+}

+ 2 - 1
src/main/java/com/qmth/exam/reserve/controller/UserController.java → src/main/java/com/qmth/exam/reserve/controller/admin/UserController.java

@@ -1,7 +1,8 @@
-package com.qmth.exam.reserve.controller;
+package com.qmth.exam.reserve.controller.admin;
 
 import com.qmth.boot.api.annotation.Aac;
 import com.qmth.boot.api.constant.ApiConstant;
+import com.qmth.exam.reserve.controller.BaseController;
 import com.qmth.exam.reserve.service.UserService;
 import io.swagger.annotations.Api;
 import org.springframework.beans.factory.annotation.Autowired;

+ 29 - 0
src/main/java/com/qmth/exam/reserve/controller/student/LoginController.java

@@ -0,0 +1,29 @@
+package com.qmth.exam.reserve.controller.student;
+
+import com.qmth.boot.api.annotation.Aac;
+import com.qmth.boot.api.constant.ApiConstant;
+import com.qmth.exam.reserve.bean.login.LoginReq;
+import com.qmth.exam.reserve.bean.login.SessionUser;
+import com.qmth.exam.reserve.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@Api(tags = "考生登录相关接口")
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/student")
+@Aac(strict = false, auth = false)
+public class LoginController extends BaseController {
+
+    @ApiOperation(value = "考生登录(账号)")
+    @PostMapping(value = "/login")
+    public SessionUser login(@RequestBody LoginReq req) {
+        SessionUser user = new SessionUser();
+        //todo
+        return user;
+    }
+
+}