Commit a1779dca by xmh

<feat> 添加获取定时任务配置接口

1 parent 95cf11a0
......@@ -54,6 +54,13 @@ public class ContentController extends ContentBaseController {
@ResponseBody
public JsonMessageUtil.JsonMessage<Object> timing(@RequestBody JSONObject jsonObject) {
contentService.addOrUpdateTimingConfig(jsonObject);
return JsonMessageUtil.getSuccessJsonMsg("success", null);
return JsonMessageUtil.getSuccessJsonMsg(MESSAGE_SELECT_SUCCESS, null);
}
@GetMapping("/timing")
@ResponseBody
public JsonMessageUtil.JsonMessage<JSONObject> getTiming() {
JSONObject timingConfig = contentService.getTimingConfig();
return JsonMessageUtil.getSuccessJsonMsg(MESSAGE_SELECT_SUCCESS, timingConfig);
}
}
\ No newline at end of file
......@@ -15,4 +15,6 @@ public interface ContentService extends BaseService<Content> {
ImageKeepConfig selectImageKeepConfig();
void addOrUpdateTimingConfig(JSONObject jsonObject);
JSONObject getTimingConfig();
}
\ No newline at end of file
......@@ -64,4 +64,16 @@ public class ContentServiceImpl extends BaseServiceImpl<Content> implements Cont
}
@Override
public JSONObject getTimingConfig() {
ContentExample contentExample = new ContentExample();
contentExample.createCriteria().andTypeEqualTo(PLATFORM_CONFIG).andNameEqualTo(TIMING_CONFIG);
List<Content> contents = contentMapper.selectByExampleWithBLOBs(contentExample);
if (contents.size() > 0) {
return JSONObject.parseObject(contents.get(0).getContent());
} else {
return null;
}
}
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!