시판에대한 리스트는뽑아왔어.

이제 그글누르면 상세보기를해야대는데

상세보기하려면 그글에대한 시퀀스를 뽑아와야대잖아



$(document).ready(function () {

var class="s2">"no":seq}

$.ajax({

type : 'get',

url : '/rest/api/v1/notice/notices',

contentType : 'application/x-www-form-urlencoded',

dataType : 'json',

data : data,

async : false,

success : function(data) {

console.log(data);

$("#viewTable > tbody:last").children().remove();

// var e = $(data).find('no');

//     $("추가위치").html(e);

var tbody = "";

for(var i = 0 ; i < data.length ; i++) {

tbody += "<td>"+ data[i].no +"</td>"

tbody += "<td>"+ data[i].title +"</td>"

tbody += "<td>"+ data[i].author +"</td>"

tbody += "<td>"+ new Date(data[i].regDate) +"</td>"

tbody += "<td>"+ new Date(data[i].modDate) +"</td>"

tbody += "</tr>";

$("#viewTable > tbody:last").append(tbody);

}

},

error : function(xhr, status, error) {

alert("error");

}

});

});


컨트롤러는 이렇게되있음


@RestController

@RequestMapping("/rest/api/v1/notice/notices")

public class NoticeController {


@Autowired

private NoticeService noticeService;

@RequestMapping(value = "", method = { RequestMethod.POST }, consumes = { MediaType.APPLICATION_FORM_URLENCODED_VALUE }, produces = { MediaType.APPLICATION_JSON_VALUE })

public Notice regist(@Valid Notice notice) {

return noticeService.regist(notice);

}


@RequestMapping(value = "", method = { RequestMethod.GET }, produces = { MediaType.APPLICATION_JSON_VALUE })

public PagingContents<Notice> find(@Valid PagingRequest pagingRequest) {

return noticeService.find(pagingRequest);

}


@RequestMapping(value = "/{seq}", method = { RequestMethod.GET }, produces = { MediaType.APPLICATION_JSON_VALUE })

public Notice findOne(@PathVariable int seq) {

return noticeService.findOne(seq);

}


@RequestMapping(value = "/{seq}", method = { RequestMethod.PUT }, consumes = { MediaType.APPLICATION_FORM_URLENCODED_VALUE }, produces = { MediaType.APPLICATION_JSON_VALUE })

public Notice update(@PathVariable int seq, Notice notice) {

return noticeService.update(seq, notice);

}                                                                                                                    


@RequestMapping(value = "/{seq}", method = { RequestMethod.DELETE }, produces = { MediaType.APPLICATION_JSON_VALUE })

public void delete(@PathVariable int seq) {

noticeService.delete(seq);

}


@RequestMapping(value = "", method = { RequestMethod.DELETE }, produces = { MediaType.APPLICATION_JSON_VALUE })

public void delete(@RequestParam("seqs") List<Integer> seqs) {

// noticeService.delete(seqs);

}

}