Commit 356b7c83 authored by alex yao's avatar alex yao

feat:新增接口,获取应用上架信息

parent bb8fa032
package cn.com.poc.agent_application.aggregate;
import cn.com.poc.agent_application.entity.BizAgentApplicationMallEntity;
public interface AgentApplicationMallService {
/**
* 收藏/取消收藏应用广场中的应用
......@@ -14,4 +16,11 @@ public interface AgentApplicationMallService {
*/
void addClickNumber(Integer agentPublishId) throws Exception;
/**
* 获取应用发布信息
*
* @param agentId 应用id
*/
BizAgentApplicationMallEntity getAgentPublishInfo(String agentId) throws Exception;
}
......@@ -93,4 +93,14 @@ public class AgentApplicationMallServiceImpl implements AgentApplicationMallServ
mallEntity.setClickNumber(mallEntity.getClickNumber() + 1);
bizAgentApplicationMallService.update(mallEntity);
}
@Override
public BizAgentApplicationMallEntity getAgentPublishInfo(String agentId) throws Exception {
BizAgentApplicationPublishEntity agentApplicationPublishEntity = bizAgentApplicationPublishService.getByAgentId(agentId);
if (agentApplicationPublishEntity == null) {
return null;
}
Integer publishId = agentApplicationPublishEntity.getId();
return bizAgentApplicationMallService.getByAgentPublishId(publishId);
}
}
......@@ -34,6 +34,7 @@ public class BizAgentApplicationMallConvert {
entity.setIsCopy(model.getIsCopy());
entity.setIsSale(model.getIsSale());
entity.setPopularity(model.getPopularity());
entity.setCreatedTime(model.getCreatedTime());
return entity;
}
......
......@@ -35,6 +35,7 @@ public class BizAgentApplicationPublishConvert {
entity.setAgentSystem(model.getAgentSystem());
entity.setPreamble(model.getPreamble());
entity.setIsLongMemory(model.getIsLongMemory());
entity.setPublishTime(model.getCreatedTime());
if (StringUtils.isNotBlank(model.getVariableStructure())) {
entity.setVariableStructure(JsonUtils.deSerialize(model.getVariableStructure(), new TypeReference<List<Variable>>() {
}.getType()));
......
package cn.com.poc.agent_application.dto;
import java.util.Date;
/**
* Agent应用上架信息
*/
public class AgentApplicationMallInfoDto {
private String agentId;
private Integer agentPublishId;
private Integer categoryId;
private String isCopy;
private String isSale;
private Date launchTime;
public String getAgentId() {
return agentId;
}
public void setAgentId(String agentId) {
this.agentId = agentId;
}
public Integer getAgentPublishId() {
return agentPublishId;
}
public void setAgentPublishId(Integer agentPublishId) {
this.agentPublishId = agentPublishId;
}
public Integer getCategoryId() {
return categoryId;
}
public void setCategoryId(Integer categoryId) {
this.categoryId = categoryId;
}
public String getIsCopy() {
return isCopy;
}
public void setIsCopy(String isCopy) {
this.isCopy = isCopy;
}
public String getIsSale() {
return isSale;
}
public void setIsSale(String isSale) {
this.isSale = isSale;
}
public Date getLaunchTime() {
return launchTime;
}
public void setLaunchTime(Date launchTime) {
this.launchTime = launchTime;
}
}
......@@ -3,4 +3,25 @@ package cn.com.poc.agent_application.dto;
public class BizAgentApplicationPublishDto extends AgentApplicationInfoDto{
private String isSale;
private String isCopy;
@Override
public String getIsSale() {
return isSale;
}
@Override
public void setIsSale(String isSale) {
this.isSale = isSale;
}
public String getIsCopy() {
return isCopy;
}
public void setIsCopy(String isCopy) {
this.isCopy = isCopy;
}
}
\ No newline at end of file
package cn.com.poc.agent_application.rest;
import cn.com.poc.agent_application.dto.AgentApplicationMallCategoryDto;
import cn.com.poc.agent_application.dto.AgentApplicationMallInfoDto;
import cn.com.poc.agent_application.dto.AgentApplicationMallQueryDto;
import cn.com.yict.framemax.core.rest.BaseRest;
import cn.com.poc.agent_application.dto.BizAgentApplicationMallDto;
......@@ -58,4 +59,12 @@ public interface BizAgentApplicationMallRest extends BaseRest {
*/
List<AgentApplicationMallCategoryDto> getMallCategoryList(HttpServletRequest httpServletRequest) throws Exception;
/**
* 获取应用上架信息
*
* @param agentId 应用id
*/
@Permission(Access.Anonymous)
AgentApplicationMallInfoDto getMallInfoByAgentId(@RequestParam String agentId) throws Exception;
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ package cn.com.poc.agent_application.rest.impl;
import cn.com.poc.agent_application.aggregate.AgentApplicationMallService;
import cn.com.poc.agent_application.convert.BizAgentApplicationMallConvert;
import cn.com.poc.agent_application.dto.AgentApplicationMallCategoryDto;
import cn.com.poc.agent_application.dto.AgentApplicationMallInfoDto;
import cn.com.poc.agent_application.dto.AgentApplicationMallQueryDto;
import cn.com.poc.agent_application.dto.BizAgentApplicationMallDto;
import cn.com.poc.agent_application.entity.BizAgentApplicationCategoryEntity;
......@@ -192,4 +193,21 @@ public class BizAgentApplicationMallRestImpl implements BizAgentApplicationMallR
}
return result;
}
@Override
public AgentApplicationMallInfoDto getMallInfoByAgentId(String agentId) throws Exception {
Assert.notNull(agentId);
BizAgentApplicationMallEntity agentPublishInfo = agentApplicationMallService.getAgentPublishInfo(agentId);
if (agentPublishInfo == null) {
return null;
}
AgentApplicationMallInfoDto dto = new AgentApplicationMallInfoDto();
dto.setAgentId(agentId);
dto.setAgentPublishId(agentPublishInfo.getAgentPublishId());
dto.setCategoryId(agentPublishInfo.getCategoryId());
dto.setIsCopy(agentPublishInfo.getIsCopy());
dto.setIsSale(agentPublishInfo.getIsSale());
dto.setLaunchTime(agentPublishInfo.getCreatedTime());
return dto;
}
}
\ 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