Commit 89a0552e authored by jgomez's avatar jgomez

SchedulerTask, calendar, calendarExeption

Correccion en modelos
parent a577f209
package com.bytesw.bytebot.controller;
import com.bytesw.bytebot.bean.CalendarExceptionBean;
import com.bytesw.bytebot.service.CalendarExceptionService;
import com.bytesw.xdf.annotation.ProgramSecurity;
import com.bytesw.xdf.controller.XDFController;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.math.BigInteger;
import java.util.List;
import java.util.Map;
@RestController()
@RequestMapping("/calendar-exception")
@ProgramSecurity("calendar-exception")
@Log4j2
public class CalendarExceptionController extends XDFController<CalendarExceptionBean, BigInteger> {
@Autowired
CalendarExceptionService service;
public CalendarExceptionController(CalendarExceptionService service) {
super(service);
}
@ApiResponses({@ApiResponse(
code = 200,
message = "Success",
response = ResponseEntity.class
), @ApiResponse(
code = 404,
message = "Not Found"
), @ApiResponse(
code = 505,
message = "Internal Server Error"
)})
@RequestMapping(
value = {"/find-by-calendar-id"},
method = {RequestMethod.POST}
)
@ResponseBody
@PreAuthorize("hasPermission(this, 'view')")
public ResponseEntity<String> getCalendarExceptionbyID(@RequestBody Map<String, String> parametersCalendar, HttpServletRequest req) {
List<CalendarExceptionBean> calendarExceptionBeanList = this.service.getCalendarExceptionbyID(parametersCalendar);
return new ResponseEntity(this.gson.toJson(calendarExceptionBeanList), HttpStatus.OK);
}
}
...@@ -12,7 +12,7 @@ import java.util.List; ...@@ -12,7 +12,7 @@ import java.util.List;
@Audited @Audited
@Entity @Entity
@Table(name = "avb_calendar") @Table(name = "AVB_CALENDAR")
@NamedQuery(name = "Calendar.findByPK", query = "Select u from Calendar u where u.id = ?1") @NamedQuery(name = "Calendar.findByPK", query = "Select u from Calendar u where u.id = ?1")
@Getter @Getter
@Setter @Setter
......
...@@ -13,7 +13,7 @@ import java.math.BigInteger; ...@@ -13,7 +13,7 @@ import java.math.BigInteger;
@Audited @Audited
@Entity @Entity
@Table(name = "GTW_SCHEDULER_TASK") @Table(name = "AVB_SCHEDULER_TASK")
@NamedQuery(name = "SchedulerTasks.findByPK", query = "Select u from SchedulerTask u where u.id = ?1") @NamedQuery(name = "SchedulerTasks.findByPK", query = "Select u from SchedulerTask u where u.id = ?1")
@Getter @Getter
@Setter @Setter
...@@ -23,12 +23,12 @@ public class SchedulerTask implements Serializable { ...@@ -23,12 +23,12 @@ public class SchedulerTask implements Serializable {
@Id @Id
@Column(name = "SHTA_ID") @Column(name = "SHTA_ID")
@SequenceGenerator(name = "GTW_SCHEDULER_TASK_GENERATOR", sequenceName = "GTW_SCHEDULER_TASK_SEQ", initialValue = 1, allocationSize = 1) @SequenceGenerator(name = "AVB_SCHEDULER_TASK_GENERATOR", sequenceName = "AVB_SCHEDULER_TASK_SEQ", initialValue = 1, allocationSize = 1)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "GTW_SCHEDULER_TASK_GENERATOR") @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "AVB_SCHEDULER_TASK_GENERATOR")
private BigInteger id; private BigInteger id;
@Version @Version
@Column(name = "VERSION") @Column(name = "SHTA_VERSION")
@Basic(optional = false) @Basic(optional = false)
private long version; private long version;
......
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