Commit 8c2a02f2 authored by 廖旭伟's avatar 廖旭伟

增加应用分类列表查询接口

parent bcc63ade
package com.mortals.xhx.common.pdu.app;
import com.mortals.framework.model.BaseEntityLong;
import lombok.Data;
@Data
public class AppCategoryPdu extends BaseEntityLong {
private static final long serialVersionUID = 1L;
/**
* 站点Id
*/
private Long siteId;
/**
* 站点名称
*/
private String siteName;
/**
* 分类编码
*/
private String categoryCode;
/**
* 分类名称
*/
private String categoryName;
/**
* 排序字段
*/
private Integer sort;
/**
* 封面
*/
private String cover;
/**
* 备注
*/
private String remark;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof AppCategoryPdu) {
AppCategoryPdu tmp = (AppCategoryPdu) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.siteId = -1L;
this.siteName = "";
this.categoryCode = "";
this.categoryName = "";
this.sort = 0;
this.cover = "";
this.remark = "";
}
}
......@@ -2,6 +2,7 @@ package com.mortals.xhx.feign.app;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.app.AppCategoryPdu;
import com.mortals.xhx.common.pdu.app.AppPdu;
import com.mortals.xhx.common.pdu.app.DeviceBlackappPdu;
import com.mortals.xhx.common.pdu.device.DevicePdu;
......@@ -48,6 +49,15 @@ public interface IAppFeign extends IFeign {
*/
@PostMapping(value = "/device/blackapp/list")
Rest<RespData<List<DeviceBlackappPdu>>> blackappList(@RequestBody DeviceBlackappPdu appPdu);
/**
* 自助终端应用分类
*
* @param appPdu
* @return
*/
@PostMapping(value = "/app/category/list")
Rest<RespData<List<AppCategoryPdu>>> categoryList(@RequestBody AppCategoryPdu appPdu);
}
@Slf4j
......@@ -72,6 +82,11 @@ class AppFeignFallbackFactory implements FallbackFactory<IAppFeign> {
public Rest<RespData<List<DeviceBlackappPdu>>> blackappList(DeviceBlackappPdu appPdu) {
return Rest.fail("暂时无法获取设备应用黑名单,请稍后再试!");
}
@Override
public Rest<RespData<List<AppCategoryPdu>>> categoryList(AppCategoryPdu appPdu) {
return Rest.fail("暂时无法获取自助终端应用分类,请稍后再试!");
}
};
}
}
\ No newline at end of file
package com.mortals.xhx.module.sst.web;
import com.mortals.framework.annotation.RepeatSubmit;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.IUser;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.app.AppCategoryPdu;
import com.mortals.xhx.common.pdu.site.SitePdu;
import com.mortals.xhx.feign.app.IAppFeign;
import com.mortals.xhx.module.sst.service.SstAppsDeskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -40,6 +45,8 @@ public class SstAppsController extends BaseCRUDJsonBodyMappingController<SstApps
private ParamService paramService;
@Autowired
private SstAppsDeskService sstAppsDeskService;
@Autowired
private IAppFeign appFeign;
public SstAppsController(){
super.setModuleDesc( "应用编排");
......@@ -79,4 +86,35 @@ public class SstAppsController extends BaseCRUDJsonBodyMappingController<SstApps
return ret;
}
@PostMapping({"category/list"})
@UnAuth
public Rest<Object> categoryList(@RequestBody AppCategoryPdu query) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "查询应用分类列表";
int code;
try {
Rest<RespData<List<AppCategoryPdu>>> result = appFeign.categoryList(query);
code = result.getCode();
if(code > 0) {
model.put("data", result.getData().getData());
model.put("pageInfo", result.getData().getPageInfo());
model.put("dict", result.getData().getDict());
}
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
ret.setCode(code);
ret.setData(model);
ret.setDict(model.get("dict"));
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment