Commit 142501b7 authored by Roberto Loayza Miljanovich's avatar Roberto Loayza Miljanovich

Merge branch 'dev_marcos' into 'developer'

Dev marcos

See merge request ByteBot/web/bytebot-service!15
parents a78ad984 1b9ba02e
...@@ -56,6 +56,9 @@ public class AgentBean { ...@@ -56,6 +56,9 @@ public class AgentBean {
@Expose @Expose
private String type; private String type;
@Expose
private int period;
@Expose @Expose
private List<DeploymentChannelBean> deploymentChannels; private List<DeploymentChannelBean> deploymentChannels;
......
package com.bytesw.bytebot.controller; package com.bytesw.bytebot.controller;
import com.bytesw.bytebot.bean.AgentBean; import com.bytesw.bytebot.bean.AgentBean;
import com.bytesw.bytebot.controller.bean.ResponseController; import com.bytesw.bytebot.controller.bean.ResponseController;
import com.bytesw.bytebot.http.FileValidationResponse; import com.bytesw.bytebot.http.FileValidationResponse;
...@@ -24,8 +23,6 @@ import org.springframework.security.access.prepost.PreAuthorize; ...@@ -24,8 +23,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
@Log4j2 @Log4j2
@RestController @RestController
@RequestMapping("/service/agent") @RequestMapping("/service/agent")
......
...@@ -3,11 +3,9 @@ package com.bytesw.bytebot.model; ...@@ -3,11 +3,9 @@ package com.bytesw.bytebot.model;
import com.bytesw.bytebot.model.converters.AgentStatusConverter; import com.bytesw.bytebot.model.converters.AgentStatusConverter;
import com.bytesw.bytebot.model.converters.AgentTypeConverter; import com.bytesw.bytebot.model.converters.AgentTypeConverter;
import com.bytesw.bytebot.model.converters.LanguageConverter; import com.bytesw.bytebot.model.converters.LanguageConverter;
import com.bytesw.bytebot.model.converters.StatusConverter;
import com.bytesw.bytebot.model.enums.AgentStatusEnum; import com.bytesw.bytebot.model.enums.AgentStatusEnum;
import com.bytesw.bytebot.model.enums.AgentTypeEnum; import com.bytesw.bytebot.model.enums.AgentTypeEnum;
import com.bytesw.bytebot.model.enums.LanguageEnum; import com.bytesw.bytebot.model.enums.LanguageEnum;
import com.bytesw.bytebot.model.enums.StatusEnum;
import lombok.*; import lombok.*;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
...@@ -45,7 +43,7 @@ public class Agent implements Serializable { ...@@ -45,7 +43,7 @@ public class Agent implements Serializable {
private String timezone; private String timezone;
@Column(name = "agen_delete_sensible_period") @Column(name = "agen_delete_sensible_period")
private String period; private int period;
@Lob @Lob
@Type(type = "org.hibernate.type.TextType") @Type(type = "org.hibernate.type.TextType")
......
...@@ -2,7 +2,6 @@ package com.bytesw.bytebot.repository; ...@@ -2,7 +2,6 @@ package com.bytesw.bytebot.repository;
import com.bytesw.bytebot.model.Agent; import com.bytesw.bytebot.model.Agent;
import com.bytesw.bytebot.model.enums.AgentStatusEnum; import com.bytesw.bytebot.model.enums.AgentStatusEnum;
import com.bytesw.bytebot.bean.AgentBean;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.CrudRepository;
......
...@@ -142,6 +142,7 @@ public class AgentService extends CustomPaginationService<Agent> { ...@@ -142,6 +142,7 @@ public class AgentService extends CustomPaginationService<Agent> {
agentBD.setVersion(agent.getVersion()); agentBD.setVersion(agent.getVersion());
agentBD.setType(AgentTypeEnum.fromString(agent.getType())); agentBD.setType(AgentTypeEnum.fromString(agent.getType()));
agentBD.setAvatar(agent.getAvatar()); agentBD.setAvatar(agent.getAvatar());
agentBD.setPeriod(agent.getPeriod());
if (agent.getCountryId() != null) { if (agent.getCountryId() != null) {
Optional<Country> countryFound = countryRepository.findById(agent.getCountryId()); Optional<Country> countryFound = countryRepository.findById(agent.getCountryId());
...@@ -360,6 +361,7 @@ public class AgentService extends CustomPaginationService<Agent> { ...@@ -360,6 +361,7 @@ public class AgentService extends CustomPaginationService<Agent> {
bean.setType(agent.getType().getName()); bean.setType(agent.getType().getName());
bean.setStatus(agent.getStatus().getName()); bean.setStatus(agent.getStatus().getName());
bean.setAvatar(agent.getAvatar()); bean.setAvatar(agent.getAvatar());
bean.setPeriod(agent.getPeriod());
if (agent.getCountry() != null) { if (agent.getCountry() != null) {
bean.setCountryName(agent.getCountry().getName()); bean.setCountryName(agent.getCountry().getName());
......
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