| Required role: | super-admin |
| GET | /login-history |
|---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
/**
* Lấy lịch sử đăng nhập
*/
public static class LoginHistoryRequest
{
public Integer userId = null;
public String userName = null;
public Date startDate = null;
public Date endDate = null;
public Integer page = null;
public Integer limit = null;
public Integer getUserId() { return userId; }
public LoginHistoryRequest setUserId(Integer value) { this.userId = value; return this; }
public String getUserName() { return userName; }
public LoginHistoryRequest setUserName(String value) { this.userName = value; return this; }
public Date getStartDate() { return startDate; }
public LoginHistoryRequest setStartDate(Date value) { this.startDate = value; return this; }
public Date getEndDate() { return endDate; }
public LoginHistoryRequest setEndDate(Date value) { this.endDate = value; return this; }
public Integer getPage() { return page; }
public LoginHistoryRequest setPage(Integer value) { this.page = value; return this; }
public Integer getLimit() { return limit; }
public LoginHistoryRequest setLimit(Integer value) { this.limit = value; return this; }
}
public static class LoginHistoryRespnse implements IResponseRequest
{
public ArrayList<UserLoginHistoryDto> data = null;
public Integer totalRecords = null;
public Integer code = null;
public String message = null;
public ArrayList<UserLoginHistoryDto> getData() { return data; }
public LoginHistoryRespnse setData(ArrayList<UserLoginHistoryDto> value) { this.data = value; return this; }
public Integer getTotalRecords() { return totalRecords; }
public LoginHistoryRespnse setTotalRecords(Integer value) { this.totalRecords = value; return this; }
public Integer getCode() { return code; }
public LoginHistoryRespnse setCode(Integer value) { this.code = value; return this; }
public String getMessage() { return message; }
public LoginHistoryRespnse setMessage(String value) { this.message = value; return this; }
}
public static class UserLoginHistoryDto extends UserLoginHistory
{
public Integer failedLoginCount = null;
public Integer getFailedLoginCount() { return failedLoginCount; }
public UserLoginHistoryDto setFailedLoginCount(Integer value) { this.failedLoginCount = value; return this; }
}
public static class UserLoginHistory
{
public Integer id = null;
public Integer userId = null;
@StringLength(150)
public String userName = null;
@StringLength(45)
public String ipAddress = null;
@StringLength(500)
public String deviceInfo = null;
@StringLength(50)
public String loginStatus = null;
@StringLength(500)
public String failReason = null;
@Required()
public Date createdAt = null;
public String provider = null;
public Integer getId() { return id; }
public UserLoginHistory setId(Integer value) { this.id = value; return this; }
public Integer getUserId() { return userId; }
public UserLoginHistory setUserId(Integer value) { this.userId = value; return this; }
public String getUserName() { return userName; }
public UserLoginHistory setUserName(String value) { this.userName = value; return this; }
public String getIpAddress() { return ipAddress; }
public UserLoginHistory setIpAddress(String value) { this.ipAddress = value; return this; }
public String getDeviceInfo() { return deviceInfo; }
public UserLoginHistory setDeviceInfo(String value) { this.deviceInfo = value; return this; }
public String getLoginStatus() { return loginStatus; }
public UserLoginHistory setLoginStatus(String value) { this.loginStatus = value; return this; }
public String getFailReason() { return failReason; }
public UserLoginHistory setFailReason(String value) { this.failReason = value; return this; }
public Date getCreatedAt() { return createdAt; }
public UserLoginHistory setCreatedAt(Date value) { this.createdAt = value; return this; }
public String getProvider() { return provider; }
public UserLoginHistory setProvider(String value) { this.provider = value; return this; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /login-history HTTP/1.1 Host: etc-api.vsmlab.vn Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"data":[{"failedLoginCount":0,"id":0,"userId":0,"userName":"String","ipAddress":"String","deviceInfo":"String","loginStatus":"String","failReason":"String","createdAt":"0001-01-01T00:00:00.0000000+07:06","provider":"String"}],"totalRecords":0,"code":0,"message":"String"}