HipoteseLegalController.java
1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package br.com.centralit.controller;
import java.util.Collection;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import br.com.centralit.api.framework.json.ViewsEcm;
import br.com.centralit.api.model.HipoteseLegal;
import br.com.centralit.api.service.HipoteseLegalService;
import br.com.centralit.framework.controller.GenericController;
import br.com.centralit.framework.json.ResponseBodyWrapper;
@Controller
@RequestMapping("/rest/hipoteseLegal")
public class HipoteseLegalController extends GenericController<HipoteseLegal> {
/** Atributo hipoteseLegalService. */
private HipoteseLegalService hipoteseLegalService;
@Autowired
public HipoteseLegalController( HipoteseLegalService hipoteseLegalService ) {
super(hipoteseLegalService);
this.hipoteseLegalService = hipoteseLegalService;
}
@RequestMapping(value = "/findPorNivelAcesso", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public ResponseBodyWrapper findPorNivelAcesso(@RequestParam(value = "idNivelAcesso") Long idNivelAcesso) {
final Collection<HipoteseLegal> hipoteses = this.hipoteseLegalService.findPorNivelAcesso(idNivelAcesso);
ResponseBodyWrapper responseBody = new ResponseBodyWrapper(hipoteses, ViewsEcm.HipoteseLegalList.class);
return responseBody;
}
@Override
public Class<ViewsEcm.HipoteseLegalEdit> getEditView() {
return ViewsEcm.HipoteseLegalEdit.class;
}
@Override
public Class<ViewsEcm.HipoteseLegalList> getListView() {
return ViewsEcm.HipoteseLegalList.class;
}
}