|
@ -1,9 +1,7 @@
|
|
|
package com.yihu.jw.hospital.endpoint.article;
|
|
|
|
|
|
import com.yihu.jw.article.service.BaseMenuManageService;
|
|
|
import com.yihu.jw.entity.base.menu.BaseLinkDictDO;
|
|
|
import com.yihu.jw.entity.base.menu.BaseMenuDictDO;
|
|
|
import com.yihu.jw.entity.base.menu.BaseMenuShowDO;
|
|
|
import com.yihu.jw.restmodel.web.Envelop;
|
|
|
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
|
|
|
import com.yihu.jw.rm.base.BaseRequestMapping;
|
|
@ -43,7 +41,7 @@ public class BaseMenuManageEndpoint extends EnvelopRestEndpoint {
|
|
|
@ApiParam(name = "jsonData", value = "Json数据", required = true)
|
|
|
@RequestParam String jsonData) {
|
|
|
try {
|
|
|
BaseMenuDictDO baseMenuDictDO = menuService.createOrUpdateMenu(jsonData);
|
|
|
BaseMenuDictDO baseMenuDictDO = menuService.createOrUpdateMenu(jsonData,2);
|
|
|
return success(baseMenuDictDO);
|
|
|
} catch (Exception e) {
|
|
|
return failedException(e);
|
|
@ -111,196 +109,7 @@ public class BaseMenuManageEndpoint extends EnvelopRestEndpoint {
|
|
|
@ApiParam(name = "status", value = "status", required = false)
|
|
|
@RequestParam(value = "status",required = false) Integer status) {
|
|
|
try {
|
|
|
return success(menuService.findMenuDictByKey(parentId, name,status));
|
|
|
}catch (Exception e){
|
|
|
return failedException(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = BaseRequestMapping.LinkDict.createLinkDict)
|
|
|
@ApiOperation(value = "新建或修改")
|
|
|
public Envelop createLink (
|
|
|
@ApiParam(name = "jsonData", value = "Json数据", required = true)
|
|
|
@RequestParam String jsonData) {
|
|
|
try {
|
|
|
BaseLinkDictDO baseLinkDictDO = menuService.createOrUpdateLink(jsonData);
|
|
|
return success(baseLinkDictDO);
|
|
|
} catch (Exception e) {
|
|
|
return failedException(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@PostMapping(value = BaseRequestMapping.LinkDict.MOVELinkDOWN)
|
|
|
@ApiOperation(value = "下移")
|
|
|
public Envelop moveDownDict(
|
|
|
@ApiParam(name = "id", value = "id", required = true)
|
|
|
@RequestParam(value = "id") String id) {
|
|
|
try {
|
|
|
BaseLinkDictDO baseLinkDictDO = menuService.downlink(id);
|
|
|
return success(baseLinkDictDO);
|
|
|
}catch (Exception e){
|
|
|
return failedException(e);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
@PostMapping(value = BaseRequestMapping.LinkDict.MOVELinkUP)
|
|
|
@ApiOperation(value = "上移")
|
|
|
public Envelop moveLink(
|
|
|
@ApiParam(name = "id", value = "id", required = true)
|
|
|
@RequestParam(value = "id") String id) {
|
|
|
try {
|
|
|
BaseLinkDictDO baseLinkDictDO = menuService.upLink(id);
|
|
|
return success(baseLinkDictDO);
|
|
|
}catch (Exception e){
|
|
|
return failedException(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@PostMapping(value = BaseRequestMapping.LinkDict.linkStatus)
|
|
|
@ApiOperation(value = "生效/失效")
|
|
|
public Envelop statusLink(
|
|
|
@ApiParam(name = "id", value = "id", required = true)
|
|
|
@RequestParam(value = "id") String id,
|
|
|
@ApiParam(name = "status", value = "1生效,0失效", required = true)
|
|
|
@RequestParam(value = "status") String status) {
|
|
|
try {
|
|
|
menuService.updateLinkStatus(id, status);
|
|
|
return success("修改成功");
|
|
|
}catch (Exception e){
|
|
|
return failedException(e);
|
|
|
}
|
|
|
}
|
|
|
@PostMapping(value = BaseRequestMapping.LinkDict.findOneLink)
|
|
|
@ApiOperation(value = "根据id查询链接单条")
|
|
|
public Envelop findOneLink(
|
|
|
@ApiParam(name = "id", value = "id", required = true)
|
|
|
@RequestParam(value = "id") String id) {
|
|
|
try {
|
|
|
return success(menuService.findOneLinkDict(id));
|
|
|
}catch (Exception e){
|
|
|
return failedException(e);
|
|
|
}
|
|
|
}
|
|
|
@PostMapping(value = BaseRequestMapping.LinkDict.deleteLink)
|
|
|
@ApiOperation(value = "删除链接")
|
|
|
public Envelop deleteLink(
|
|
|
@ApiParam(name = "id", value = "id", required = true)
|
|
|
@RequestParam(value = "id") String id) {
|
|
|
try {
|
|
|
menuService.updateLinkDel(id);
|
|
|
return success("删除成功");
|
|
|
}catch (Exception e){
|
|
|
return failedException(e);
|
|
|
}
|
|
|
}
|
|
|
@PostMapping(value = BaseRequestMapping.LinkDict.linkShow)
|
|
|
@ApiOperation(value = "生效/失效")
|
|
|
public Envelop isShow(
|
|
|
@ApiParam(name = "id", value = "id", required = true)
|
|
|
@RequestParam(value = "id") String id,
|
|
|
@ApiParam(name = "status", value = "1展示0不展示", required = true)
|
|
|
@RequestParam(value = "status") String status) {
|
|
|
try {
|
|
|
menuService.updateLinkShow(id, status);
|
|
|
return success("修改成功");
|
|
|
}catch (Exception e){
|
|
|
return failedException(e);
|
|
|
}
|
|
|
}
|
|
|
@GetMapping(value = BaseRequestMapping.LinkDict.findLinkDictALL)
|
|
|
@ApiOperation(value = "查询友情链接字典列表")
|
|
|
public Envelop findLinkDictByKey(
|
|
|
@ApiParam(name = "name", value = "name", required = false)
|
|
|
@RequestParam(value = "name",required = false) String name,
|
|
|
@ApiParam(name = "status", value = "status", required = false)
|
|
|
@RequestParam(value = "status",required = false) String status) {
|
|
|
try {
|
|
|
return success(menuService.findLinkDict(name,status));
|
|
|
}catch (Exception e){
|
|
|
return failedException(e);
|
|
|
}
|
|
|
}
|
|
|
@PostMapping(value = BaseRequestMapping.MenuShow.menuShowstatus)
|
|
|
@ApiOperation(value = "移除")
|
|
|
public Envelop removeMenu(
|
|
|
@ApiParam(name = "id", value = "id", required = true)
|
|
|
@RequestParam(value = "id") String id) {
|
|
|
try {
|
|
|
menuService.removeMenu(id);
|
|
|
return success("修改成功");
|
|
|
}catch (Exception e){
|
|
|
return failedException(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
@PostMapping(value = BaseRequestMapping.MenuShow.createMenuShow)
|
|
|
@ApiOperation(value = "新建或修首页菜单")
|
|
|
public Envelop createMenuShow (
|
|
|
@ApiParam(name = "jsonData", value = "Json数据", required = true)
|
|
|
@RequestParam String jsonData) {
|
|
|
try {
|
|
|
menuService.saveMenuShow(jsonData);
|
|
|
return success("操作成功");
|
|
|
} catch (Exception e) {
|
|
|
return failedException(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@PostMapping(value = BaseRequestMapping.MenuShow.MOVEMenuShowDOWN)
|
|
|
@ApiOperation(value = "下移")
|
|
|
public Envelop moveDownShow(
|
|
|
@ApiParam(name = "id", value = "id", required = true)
|
|
|
@RequestParam(value = "id") String id) {
|
|
|
try {
|
|
|
BaseMenuShowDO baseMenuShowDO= menuService.downMenuShow(id);
|
|
|
return success(baseMenuShowDO);
|
|
|
}catch (Exception e){
|
|
|
return failedException(e);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
@PostMapping(value = BaseRequestMapping.MenuShow.MOVEMenuShowUP)
|
|
|
@ApiOperation(value = "上移")
|
|
|
public Envelop moveUpShow(
|
|
|
@ApiParam(name = "id", value = "id", required = true)
|
|
|
@RequestParam(value = "id") String id) {
|
|
|
try {
|
|
|
BaseMenuShowDO baseMenuShowDO = menuService.upMenuShow(id);
|
|
|
return success(baseMenuShowDO);
|
|
|
}catch (Exception e){
|
|
|
return failedException(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
@GetMapping(value = BaseRequestMapping.MenuShow.findMenuShow)
|
|
|
@ApiOperation(value = "查询首页列表")
|
|
|
public Envelop findMenuShowByKey(
|
|
|
@ApiParam(name = "parentId", value = "parentId", required = false)
|
|
|
@RequestParam(value = "parentId",required = false) String parentId,
|
|
|
@ApiParam(name = "name", value = "name", required = false)
|
|
|
@RequestParam(value = "name",required = false) String name) {
|
|
|
try {
|
|
|
return success(menuService.findMenuShow());
|
|
|
}catch (Exception e){
|
|
|
return failedException(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
@GetMapping(value = BaseRequestMapping.MenuShow.findMenuShowDict)
|
|
|
@ApiOperation(value = "查询首页菜单词典列表")
|
|
|
public Envelop findMenuShowDict(@ApiParam(name = "parentId", value = "parentId", required = false)
|
|
|
@RequestParam(value = "parentId",required = false) String parentId,
|
|
|
@ApiParam(name = "name", value = "name", required = false)
|
|
|
@RequestParam(value = "name",required = false) String name) {
|
|
|
try {
|
|
|
return success(menuService.findMenuDictParent(parentId,name));
|
|
|
return success(menuService.findMenuDictByKey(parentId, name,status,2));
|
|
|
}catch (Exception e){
|
|
|
return failedException(e);
|
|
|
}
|