|
@@ -0,0 +1,45 @@
|
|
|
+package com.ym.mec.student.controller;
|
|
|
+
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+
|
|
|
+import java.util.Date;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.http.MediaType;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import com.ym.mec.biz.dal.entity.TenantApply;
|
|
|
+import com.ym.mec.biz.service.TenantApplyService;
|
|
|
+import com.ym.mec.common.controller.BaseController;
|
|
|
+import com.ym.mec.common.service.IdGeneratorService;
|
|
|
+
|
|
|
+@RequestMapping("tenantApply")
|
|
|
+@Api(tags = "机构申请服务")
|
|
|
+@RestController
|
|
|
+public class TenantApplyController extends BaseController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TenantApplyService tenantApplyService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IdGeneratorService smsCodeService;
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation("新增")
|
|
|
+ @PostMapping(value = "/add", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
+ public Object add(TenantApply tenantApply) {
|
|
|
+
|
|
|
+ boolean b = smsCodeService.verifyValidCode(tenantApply.getMobileNo(), tenantApply.getSmsCode());
|
|
|
+ if (!b) {
|
|
|
+ return failed("验证码不正确");
|
|
|
+ }
|
|
|
+
|
|
|
+ tenantApply.setCreateTime(new Date());
|
|
|
+ tenantApplyService.insert(tenantApply);
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
+
|
|
|
+}
|