mirror of https://github.com/halo-dev/halo
Complete link team view api
parent
f36f101f08
commit
b2c41adadb
|
@ -1,19 +0,0 @@
|
|||
package cc.ryanc.halo.model.dto;
|
||||
|
||||
import cc.ryanc.halo.model.dto.base.OutputConverter;
|
||||
import cc.ryanc.halo.model.entity.Link;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : RYAN0UP
|
||||
* @date : 2019/3/22
|
||||
*/
|
||||
@Data
|
||||
public class LinkTeamOutputDTO implements OutputConverter<LinkTeamOutputDTO, Link> {
|
||||
|
||||
private String team;
|
||||
|
||||
private List<Link> links;
|
||||
}
|
|
@ -35,7 +35,7 @@ public class LinkTagDirective implements TemplateDirectiveModel {
|
|||
case "list":
|
||||
env.setVariable("links", builder.build().wrap(linkService.listAll()));
|
||||
break;
|
||||
case "listTeam":
|
||||
case "listTeamVos":
|
||||
env.setVariable("links", builder.build().wrap(null));
|
||||
break;
|
||||
case "count":
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
package cc.ryanc.halo.model.vo;
|
||||
|
||||
import cc.ryanc.halo.model.dto.LinkOutputDTO;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Link team vo.
|
||||
*
|
||||
* @author : RYAN0UP
|
||||
* @date : 2019/3/22
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
public class LinkTeamVO {
|
||||
|
||||
private String team;
|
||||
|
||||
private List<LinkOutputDTO> links;
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package cc.ryanc.halo.web.controller.portal.api;
|
||||
|
||||
import cc.ryanc.halo.model.vo.LinkTeamVO;
|
||||
import cc.ryanc.halo.service.LinkService;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Portal link controller.
|
||||
*
|
||||
* @author johnniang
|
||||
* @date 4/3/19
|
||||
*/
|
||||
@RestController("PortalLinkController")
|
||||
@RequestMapping("/api/links")
|
||||
public class LinkController {
|
||||
|
||||
private final LinkService linkService;
|
||||
|
||||
public LinkController(LinkService linkService) {
|
||||
this.linkService = linkService;
|
||||
}
|
||||
|
||||
@GetMapping("team_view")
|
||||
public List<LinkTeamVO> listTeamVos(Sort sort) {
|
||||
return linkService.listTeamVos(sort);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue