Commit 0183b87a authored by 赵啸非's avatar 赵啸非

添加皮肤feign接口

parent 6e6104d4
package com.mortals.xhx.common.pdu.skin;
import java.util.Date;
import java.util.List;
import com.mortals.framework.model.BaseEntityLong;
import lombok.Data;
/**
* 皮肤属性字段配置Pdu对象
*
* @author zxfei
* @date 2023-12-12
*/
@Data
public class SkinFieldPdu extends BaseEntityLong {
private static final long serialVersionUID = 1L;
/**
* 皮肤id
*/
private Long skinId;
/**
* 模板id,不为空时为模板配置属性
*/
private Long templateId;
/**
* 字段编码
*/
private String fieldCode;
/**
* 字段名称
*/
private String fieldName;
/**
* 数据类型(1.颜色,2.图片地址)
*/
private String fieldType;
/**
* 字段值
*/
private String fieldValue;
/**
* 数据长度,默认100
*/
private Integer fieldLen;
/**
* 是否允许为空,0否1是
*/
private Integer fieldNull;
/**
* 排序号
*/
private String fieldOrderNo;
/**
* 备注
*/
private String remark;
/**
* 是否启用,0否1是
*/
private Integer enabled;
public void initAttrValue(){
this.skinId = null;
this.templateId = null;
this.fieldCode = "";
this.fieldName = "";
this.fieldType = "";
this.fieldValue = "";
this.fieldLen = 100;
this.fieldNull = 1;
this.fieldOrderNo = "";
this.remark = "";
this.enabled = 1;
}
}
\ No newline at end of file
package com.mortals.xhx.feign.skin;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.skin.SkinFieldPdu;
import com.alibaba.fastjson.JSON;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.feign.IFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 皮肤属性字段配置 Feign接口
* @author zxfei
* @date 2023-12-12
*/
@FeignClient(name = "base-manager", path = "/base", fallbackFactory = SkinFieldFeignFallbackFactory.class)
public interface ISkinFieldFeign extends IFeign {
/**
* 查看皮肤属性字段配置列表
*
* @param skinFieldPdu
* @return
*/
@PostMapping(value = "/skin/field/interlist")
Rest<RespData<List<SkinFieldPdu>>> list(@RequestBody SkinFieldPdu skinFieldPdu);
/**
* 查看皮肤属性字段配置
*
* @param id
* @return
*/
@GetMapping(value = "/skin/field/interinfo")
Rest<SkinFieldPdu> info(@RequestParam(value = "id") Long id);
/**
* 删除皮肤属性字段配置
*
* @param ids
* @return
*/
@GetMapping(value = "/skin/field/delete")
Rest<Void> delete(Long[] ids,@RequestHeader("Authorization") String authorization);
/**
* 皮肤属性字段配置保存更新
*
* @param skinFieldPdu
* @return
*/
@PostMapping(value = "/skin/field/save")
Rest<RespData<SkinFieldPdu>> save(@RequestBody SkinFieldPdu skinFieldPdu,@RequestHeader("Authorization") String authorization);
}
@Slf4j
@Component
class SkinFieldFeignFallbackFactory implements FallbackFactory<ISkinFieldFeign> {
@Override
public ISkinFieldFeign create(Throwable t) {
return new ISkinFieldFeign() {
@Override
public Rest<RespData<List<SkinFieldPdu>>> list(SkinFieldPdu skinFieldPdu) {
return Rest.fail("暂时无法获取皮肤属性字段配置列表,请稍后再试!");
}
@Override
public Rest<SkinFieldPdu> info(Long id) {
return Rest.fail("暂时无法获取皮肤属性字段配置详细,请稍后再试!");
}
@Override
public Rest<Void> delete(Long[] ids, String authorization) {
return Rest.fail("暂时无法删除皮肤属性字段配置,请稍后再试!");
}
@Override
public Rest<RespData<SkinFieldPdu>> save(SkinFieldPdu skinFieldPdu, String authorization) {
return Rest.fail("暂时无法保存皮肤属性字段配置,请稍后再试!");
}
};
}
}
......@@ -143,3 +143,8 @@ INSERT INTO `mortals_xhx_resource` VALUES (null, '状态设置-菜单管理-维
-- ----------------------------
-- 状态设置参数 SQL
-- ----------------------------
INSERT INTO `mortals_xhx_param` VALUES (null, '分辨率 ', 'Skin', 'imageResolution', '1', '1920*1080', 1, 4, 0, 'imageResolution', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '分辨率 ', 'Skin', 'imageResolution', '2', '1080*1920', 1, 4, 0, 'imageResolution', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '分辨率 ', 'Skin', 'imageResolution', '3', '1280*1280', 1, 4, 0, 'imageResolution', NULL, NULL, NULL);
\ No newline at end of file
......@@ -45,6 +45,7 @@
if (res && res.code && res.code == 1) {
row.used = 0;
}
this.getData()
})
.catch((error) => {
this.$message.error(error.message);
......@@ -58,6 +59,7 @@
if (res && res.code && res.code == 1) {
row.used = 1;
}
this.getData()
})
.catch((error) => {
this.$message.error(error.message);
......@@ -76,7 +78,9 @@
{label: "产品名称", prop: "productName"},
{label: "分辨率 ", prop: "imageResolution"},
{label: "皮肤名称", prop: "name"},
{label: "分辨率 ", prop: "imageResolution",formatter:this.formatter},
{label: "预览图片", prop: "previewImagePath",formatter: (row) => {
......@@ -108,8 +112,8 @@
></el-switch>
);
},
},
{
}
/* {
label: "操作",
width: 240,
formatter: row => {
......@@ -117,7 +121,7 @@
<table-buttons noAdd row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
);
}
}
}*/
]
}
};
......
......@@ -18,8 +18,7 @@ module.exports = {
proxy: {
"/infopublish": {
//target: "http://test.office.com:11078",
//target: 'http://8.136.255.30:1061',
target: 'http://192.168.0.252:1061',
target: 'http://8.136.255.30:1061',
changeOrigin: true,
secure: false,
cookieDomainRewrite: "localhost",
......
package com.mortals.xhx.module.device.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.common.pdu.skin.SkinFieldPdu;
import com.mortals.xhx.module.device.model.DeviceEntity;
import java.util.ArrayList;
......@@ -52,4 +53,7 @@ public class DeviceVo extends BaseEntityLong {
*/
private Integer playTime;
private List<SkinFieldPdu> skinFieldList;
}
\ No newline at end of file
......@@ -8,16 +8,23 @@ import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import com.mortals.xhx.common.code.DeviceMethodEnum;
import com.mortals.xhx.common.code.DeviceStatusEnum;
import com.mortals.xhx.common.code.EnabledEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.pdu.LoginForm;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.UploadDeviceReq;
import com.mortals.xhx.common.pdu.device.DeviceReq;
import com.mortals.xhx.common.pdu.skin.SkinFieldPdu;
import com.mortals.xhx.feign.device.IDeviceFeign;
import com.mortals.xhx.feign.device.IDeviceMessageFeign;
import com.mortals.xhx.feign.skin.ISkinFieldFeign;
import com.mortals.xhx.module.device.dao.DeviceDao;
import com.mortals.xhx.module.device.model.*;
import com.mortals.xhx.module.device.service.DeviceFileService;
import com.mortals.xhx.module.device.service.DeviceService;
import com.mortals.xhx.module.device.service.DeviceWorkmanService;
import com.mortals.xhx.module.skin.model.SkinEntity;
import com.mortals.xhx.module.skin.model.SkinQuery;
import com.mortals.xhx.module.skin.service.SkinService;
import com.mortals.xhx.module.workman.model.WorkmanEntity;
import com.mortals.xhx.module.workman.service.WorkmanService;
import lombok.extern.slf4j.Slf4j;
......@@ -56,10 +63,14 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
private DeviceWorkmanService deviceWorkmanService;
@Autowired
private WorkmanService workmanService;
@Autowired
private SkinService skinService;
@Autowired
private IDeviceMessageFeign messageFeign;
@Autowired
private ISkinFieldFeign sikinFieldFeign;
@Override
protected String getExtKey(DeviceEntity data) {
return data.getDeviceCode();
......@@ -88,6 +99,23 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
deviceEntity.setDeviceWorkmanEntityList(deviceWorkmanEntityList);
deviceEntity.setDeviceFileEntityList(deviceFileEntityList);
//返回皮肤
SkinQuery skinQuery = new SkinQuery();
skinQuery.setUsed(YesNoEnum.YES.getValue());
SkinEntity skinEntity = skinService.selectOne(skinQuery);
if(ObjectUtils.isEmpty(skinEntity)){
skinEntity = skinService.selectOne(new SkinQuery());
}
if(!ObjectUtils.isEmpty(skinEntity)){
SkinFieldPdu skinFieldPdu = new SkinFieldPdu();
skinFieldPdu.setSkinId(skinEntity.getId());
Rest<RespData<List<SkinFieldPdu>>> rest = sikinFieldFeign.list(skinFieldPdu);
if(rest.getCode()==YesNoEnum.YES.getValue()){
deviceEntity.setSkinFieldList(rest.getData().getData());
}
}
return Rest.ok(deviceEntity);
}
......
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