|
@@ -0,0 +1,66 @@
|
|
|
+package com.jd.brume.controller
|
|
|
+
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
|
|
|
+import com.jd.brume.entity.ConfigEntity
|
|
|
+import com.jd.brume.service.ConfigService
|
|
|
+import com.jd.brume.util.Result
|
|
|
+import com.jd.brume.vo.ConfigVo
|
|
|
+import com.jd.brume.vo.group.UpdateGroup
|
|
|
+import org.springframework.validation.annotation.Validated
|
|
|
+import org.springframework.web.bind.annotation.GetMapping
|
|
|
+import org.springframework.web.bind.annotation.PostMapping
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping
|
|
|
+import org.springframework.web.bind.annotation.RestController
|
|
|
+
|
|
|
+import javax.annotation.Resource
|
|
|
+
|
|
|
+@Validated
|
|
|
+@RestController
|
|
|
+@RequestMapping('config')
|
|
|
+class ConfigController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ ConfigService configService
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * ²éѯÅäÖÃ
|
|
|
+ * @param deptId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping('one')
|
|
|
+ def getConfig() {
|
|
|
+ return new Result().ok(configService.getOne(null))
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * ÐÞ¸ÄÅäÖÃ
|
|
|
+ * @param corVo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping('update')
|
|
|
+ def updateConfig(@Validated(UpdateGroup) ConfigVo configVo) {
|
|
|
+ def wrapper = new UpdateWrapper<ConfigEntity>()
|
|
|
+ wrapper.set("pull_cron",configVo.pullCron)
|
|
|
+ .set("sms_cron",configVo.smsCron)
|
|
|
+ .set("api_env",configVo.apiEnv)
|
|
|
+ .set("sms_url",configVo.smsUrl)
|
|
|
+ .set("user_templet",configVo.userTemplet)
|
|
|
+ .set("party_templet",configVo.partyTemplet)
|
|
|
+ .set("sms_type",configVo.smstype)
|
|
|
+ return new Result().ok(configService.update(wrapper))
|
|
|
+ }
|
|
|
+
|
|
|
+// /**
|
|
|
+// * ³õʼ»¯
|
|
|
+// * @return
|
|
|
+// */
|
|
|
+// @GetMapping('init')
|
|
|
+// def init() {
|
|
|
+// return new Result().ok([type: dictService.getDictByType(Constant.CORP_TYPE)])
|
|
|
+// }
|
|
|
+}
|