|
@@ -0,0 +1,35 @@
|
|
|
+package com.ym.mec.web.controller;
|
|
|
+
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import com.ym.mec.biz.dal.entity.SysUserContracts;
|
|
|
+import com.ym.mec.biz.service.SysUserContractsService;
|
|
|
+import com.ym.mec.common.controller.BaseController;
|
|
|
+import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
+
|
|
|
+@RequestMapping("sysUserContracts")
|
|
|
+@Api(tags = "用户协议服务")
|
|
|
+@RestController
|
|
|
+public class SysUserContractsController extends BaseController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private SysUserContractsService sysUserContractsService;
|
|
|
+
|
|
|
+ @GetMapping("/getLatest")
|
|
|
+ public HttpResponseResult<SysUserContracts> getLatest(Integer userId) {
|
|
|
+
|
|
|
+ SysUserContracts sysUserContracts = sysUserContractsService.getLatestUserContract(userId);
|
|
|
+
|
|
|
+ if(sysUserContracts == null){
|
|
|
+ return failed("该学员尚未签署协议");
|
|
|
+ }
|
|
|
+
|
|
|
+ return succeed(sysUserContracts);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|