br.com.anteros.commons.services.rest.resource.v1.AccessTokenResource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Anteros-Services-RestSQL Show documentation
Show all versions of Anteros-Services-RestSQL Show documentation
Anteros Services REST SQL for Java.
The newest version!
package br.com.anteros.commons.services.rest.resource.v1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.context.annotation.Lazy;
import br.com.anteros.security.store.sql.domain.AccessToken;
import br.com.anteros.commons.services.rest.service.AccessTokenService;
import br.com.anteros.persistence.session.service.SQLService;
import br.com.anteros.security.spring.AnterosSecurityManager;
import br.com.anteros.spring.web.resource.AbstractSQLResourceRest;
import br.com.anteros.persistence.session.repository.Page;
import br.com.anteros.persistence.session.repository.PageRequest;
import br.com.anteros.persistence.session.repository.Pageable;
import br.com.anteros.persistence.session.repository.impl.PageImpl;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* Generated by Anteros Generator Maven Plugin at 29/12/2019 08:16:42
**/
@RestController
@RequestMapping(value = "/v1/accessToken")
public class AccessTokenResource extends AbstractSQLResourceRest {
@Autowired
@Lazy
private AccessTokenService accessTokenService;
@Autowired
@Lazy
protected AnterosSecurityManager anterosSecurityManager;
@Override
public SQLService getService() {
return accessTokenService;
}
@Override
protected Page createConcretePage(List content, PageRequest pageRequest,
long totalElements) {
return new PageAccessToken(content, pageRequest, totalElements);
}
class PageAccessToken extends PageImpl {
public PageAccessToken(List content) {
super(content);
}
public PageAccessToken(List content, Pageable pageable, long total) {
super(content, pageable, total);
}
}
@Override
protected List createConcreteList(List result) {
return new ListAccessToken(result);
}
class ListAccessToken extends ArrayList{
public ListAccessToken(Collection extends AccessToken> c) {
super(c);
}
}
}