Commit 2ad3fa3d authored by Roberto Loayza's avatar Roberto Loayza

Mantenimiento Action

parent 0683f8b6
package com.bytesw.bytebot.controller;
import com.bytesw.bytebot.etl.beans.ActionBean;
import com.bytesw.bytebot.service.ActionService;
import com.bytesw.xdf.annotation.ProgramSecurity;
import com.bytesw.xdf.controller.XDFController;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController()
@RequestMapping("/service/settings/actions")
@ProgramSecurity("ACTIONS")
@Log4j2
public class ActionController extends XDFController<ActionBean, Long> {
public ActionController(ActionService service) {
super(service);
}
}
......@@ -14,6 +14,6 @@ public class ActionBean {
private Long id;
@Expose
private String ident;
private String identifier;
}
package com.bytesw.bytebot.etl.dao;
import com.bytesw.bytebot.etl.model.Action;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import java.util.Optional;
......
package com.bytesw.bytebot.service;
import com.bytesw.bytebot.etl.beans.ActionBean;
import com.bytesw.bytebot.etl.dao.ActionRepository;
import com.bytesw.bytebot.etl.model.Action;
import com.bytesw.xdf.service.XDFService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
@Log4j2
public class ActionService extends XDFService<Action, ActionBean, Long> {
protected ActionService(ActionRepository repository) {
super(repository);
}
@Override
protected Action toModel(Action model, ActionBean bean) {
if (model == null) {
model = new Action();
}
BeanUtils.copyProperties(bean, model);
return model;
}
@Override
protected ActionBean toBean(Action model) {
ActionBean bean = new ActionBean();
BeanUtils.copyProperties(model, bean);
return bean;
}
}
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