models

package
v0.0.0-...-ee036f0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SwagBaseResponse

type SwagBaseResponse struct {
	Success    bool   `json:"success" example:"true"`    // ผลการ Request
	StatusCode string `json:"status_code" example:"200"` // HTTP Status Code
}

type SwagCreateUserRequest

type SwagCreateUserRequest struct {
	Username  string      `json:"username" example:"testuser"`        // ชื่อผู้ใช้
	Password  string      `json:"password" example:"12345678"`        // รหัสผ่าน
	Email     string      `json:"email" example:"testuser@email.com"` // อีเมล์
	FisrtName string      `json:"first_name" example:"John"`          // ชื่อ
	LastName  string      `json:"last_name" example:"Doe"`            // นามสกุล
	RoleID    int         `json:"role_id" example:"1"`                // Role ID
	Role      models.Role `json:"role"`
}

type SwagCreateUserResponse

type SwagCreateUserResponse struct {
	SwagBaseResponse
	Data SwagCreateUserResponseData `json:"data"`
}

type SwagCreateUserResponseData

type SwagCreateUserResponseData struct {
	ID        int         `json:"id" example:"1"`                                         // ID
	Username  string      `json:"username" example:"testuser"`                            // ชื่อผู้ใช้
	Email     string      `json:"email" example:"testuser@email.com"`                     // อีเมล์
	Password  string      `json:"password" example:"<hash_password>"`                     // รหัสผ่าน
	FisrtName string      `json:"first_name" example:"John"`                              // ชื่อ
	LastName  string      `json:"last_name" example:"Doe"`                                // นามสกุล
	CreatedAt time.Time   `json:"created_at" example:"2020-04-01T16:30:03.1733756+07:00"` // วันเวลาที่สร้าง
	CpdatedAt time.Time   `json:"updated_at" example:"2020-04-01T16:30:03.1733756+07:00"` // วันเวลาที่แก้ไขล่าสุด
	RoleID    int         `json:"role_id" example:"1"`                                    // Role ID
	Role      models.Role `json:"role"`
}

type SwagDeleteUserResponse

type SwagDeleteUserResponse struct {
	SwagBaseResponse
	Data string `json:"data" example:"User deleted"` // ข้อความ
}

type SwagErrorResponse

type SwagErrorResponse struct {
	Success    bool   `json:"success" example:"false"`                           // ผลการ Request
	StatusCode string `json:"status_code" example:"400"`                         // HTTP Status Code
	Errors     string `json:"errors" example:"error message or object or array"` // รายการข้อผิดพลาด
}

type SwagGetUsersResponse

type SwagGetUsersResponse struct {
	SwagBaseResponse
	Data []SwagCreateUserResponseData `json:"data"`
}

type SwagLoginRequest

type SwagLoginRequest struct {
	Username string `json:"username" example:"testuser"` // ชื่อผู้ใช้
	Password string `json:"password" example:"12345678"` // รหัสผ่าน

} //@name Request

type SwagLoginResponse

type SwagLoginResponse struct {
	SwagBaseResponse
	Expire string `json:"expire" example:"2020-04-01T19:50:19+07:00"` // วันหมดอายุของ Token
	Token  string `json:"token" example:"token"`

} //@name Response

type SwagUpdateUserRequest

type SwagUpdateUserRequest struct {
	Email           string `json:"email" example:"testuser@email.com"`  // อีเมล์
	FisrtName       string `json:"first_name" example:"John"`           // ชื่อ
	LastName        string `json:"last_name" example:"Doe"`             // นามสกุล
	CurrentPassword string `json:"current_password" example:"12345678"` // รหัสผ่านเก่า กรณีจะเปลี่ยนรหัส
	NewPassword     string `json:"new_password" example:"123456"`       // รหัสผ่านใหม่ กรณีจะเปลี่ยนรหัส
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL