|
@@ -1,8 +1,25 @@
|
|
|
package com.usky.dxtop.controller.web;
|
|
|
|
|
|
|
|
|
+import com.usky.dxtop.common.annotation.Log;
|
|
|
+import com.usky.dxtop.common.constant.UserConstants;
|
|
|
+import com.usky.dxtop.common.core.domain.AjaxResult;
|
|
|
+import com.usky.dxtop.common.core.page.TableDataInfo;
|
|
|
+import com.usky.dxtop.common.enums.BusinessType;
|
|
|
+import com.usky.dxtop.common.utils.SecurityUtils;
|
|
|
+import com.usky.dxtop.controller.BaseController;
|
|
|
+import com.usky.dxtop.model.SysConfig;
|
|
|
+import com.usky.dxtop.model.SysDictData;
|
|
|
+import com.usky.dxtop.model.TopRadio;
|
|
|
+import com.usky.dxtop.service.ISysConfigService;
|
|
|
+import com.usky.dxtop.service.TopRadioService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -14,7 +31,47 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
*/
|
|
|
@Controller
|
|
|
@RequestMapping("/dxtop/topRadio")
|
|
|
-public class TopRadioController {
|
|
|
+public class TopRadioController extends BaseController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TopRadioService topRadioService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增
|
|
|
+ * @param topRadio
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping
|
|
|
+ public AjaxResult add(@RequestBody TopRadio topRadio){
|
|
|
+ if (UserConstants.NOT_UNIQUE.equals(topRadioService.checkIdentityUnique(topRadio)))
|
|
|
+ {
|
|
|
+ return AjaxResult.error("新增身份信息'" + topRadio.getIdentity() + "'失败,身份信息已存在");
|
|
|
+ }
|
|
|
+ topRadio.setCreateBy(SecurityUtils.getUsername());
|
|
|
+ return toAjax(topRadioService.save(topRadio));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改
|
|
|
+ */
|
|
|
+ @PutMapping
|
|
|
+ public AjaxResult edit(@Validated @RequestBody TopRadio topRadio)
|
|
|
+ {
|
|
|
+ if (UserConstants.NOT_UNIQUE.equals(topRadioService.checkIdentityUnique(topRadio)))
|
|
|
+ {
|
|
|
+ return AjaxResult.error("修改身份信息'" + topRadio.getIdentity() + "'失败,身份信息已存在");
|
|
|
+ }
|
|
|
+ topRadio.setUpdateBy(SecurityUtils.getUsername());
|
|
|
+ return toAjax(topRadioService.updateById(topRadio));
|
|
|
+ }
|
|
|
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo list(TopRadio topRadio)
|
|
|
+ {
|
|
|
+ startPage();
|
|
|
+ List<TopRadio> list = topRadioService.list(topRadio);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
}
|
|
|
|