tsales_smart_flow

package module
v0.0.0-...-6797a53 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: MIT Imports: 14 Imported by: 0

README

golangsmartflow

Documentation

Index

Constants

View Source
const AppUrl = "/en/applications"

Application

View Source
const BaseUrl = `https://api.stage-smartflow.com/ext/v1`
View Source
const DepartmentUrl = "/en/departments/"

Department

View Source
const Key = "fdc0d05067ea7858ac11"
View Source
const PositionUrl = "/en/positions/"

Position

View Source
const RoleUrl = "/en/roles/"

User

View Source
const Token = "0230d82f17127f9fd3ac_613d7c9f698bcbf1b5e2"
View Source
const UserUrl = "/en/users/"
View Source
const Username = "dev_tmh@yopmail.com"

Variables

This section is empty.

Functions

func ConvertToByte

func ConvertToByte(resp interface{}) []byte

func ConvertToStruct

func ConvertToStruct(resp []byte) interface{}

Types

type AppForm

type AppForm struct {
	Body Body `json:"body"`
}

type Auth

type Auth struct {
	AuthToken string `json:"auth_token"`
}

type Body

type Body struct {
	Comment              string      `json:"comment"`
	SubmitStatus         string      `json:"submit_status"`
	TTodoTaskDetail      string      `json:"t_todo_task_detail"`
	WfsID                string      `json:"wfs_id"`
	SelectedDeptPosition string      `json:"selected_dept_position"`
	RequestForm          RequestForm `json:"request_form"`
}

type Client

type Client struct {
	Key       string
	Token     string
	AuthToken string
	BaseUrl   string
	Http
}

func Login

func Login(params map[string]string, auths map[string]string) *Client

func (*Client) AddComment

func (c *Client) AddComment(params map[string]string) interface{}

params keys

  • comment
  • wfs_id

func (*Client) CreateForm

func (c *Client) CreateForm(appId string) interface{}

func (*Client) DayOff

func (c *Client) DayOff(wfsid string, params map[string]string) interface{}

func (*Client) Delete

func (c *Client) Delete(endpoint string, params map[string]string) []byte

func (*Client) DeleteApp

func (c *Client) DeleteApp(wfsId string) interface{}

func (*Client) DeleteDepart

func (c *Client) DeleteDepart(deartId string) interface{}

func (*Client) DeleteImage

func (c *Client) DeleteImage(attachmentId string) interface{}

func (*Client) DeletePosition

func (c *Client) DeletePosition(posId string) interface{}

func (*Client) DownloadPdf

func (c *Client) DownloadPdf(params map[string]string) interface{}

params keys

  • wfs_id
  • type

func (*Client) DownloadZip

func (c *Client) DownloadZip(wfs_id string) interface{}

func (*Client) FindStatus

func (c *Client) FindStatus(wfsId string) interface{}

func (*Client) Get

func (c *Client) Get(endpoint string, params map[string]string) []byte

func (*Client) GetApps

func (c *Client) GetApps() interface{}

func (*Client) GetDepartDetail

func (c *Client) GetDepartDetail(deartId string) interface{}

func (*Client) GetDepartments

func (c *Client) GetDepartments() interface{}

func (*Client) GetItemListing

func (c *Client) GetItemListing(params map[string]string) interface{}

params keys

  • user_id
  • type

func (*Client) GetPosition

func (c *Client) GetPosition() interface{}

func (*Client) GetPositionDetail

func (c *Client) GetPositionDetail(posId string) interface{}

func (*Client) GetRoles

func (c *Client) GetRoles() interface{}

func (*Client) GetTask

func (c *Client) GetTask(params map[string]string) interface{}

params keys

  • id
  • application_name
  • User name
  • assigned_user
  • Original user
  • Proxy user
  • status
  • all_tasks
  • current_page_number

func (*Client) GetUsers

func (c *Client) GetUsers() interface{}

func (*Client) ParamInterface

func (c *Client) ParamInterface(method, endpoint string, params interface{}) []byte

func (*Client) Post

func (c *Client) Post(endpoint string, params map[string]string) []byte

func (*Client) PostDepartment

func (c *Client) PostDepartment(params map[string]string) interface{}

params keys

  • name
  • dept_code
  • detail
  • parent_id

func (*Client) PostLogin

func (c *Client) PostLogin(endpoint string, params map[string]string, auths map[string]string) []byte

func (*Client) PostPosition

func (c *Client) PostPosition(params map[string]string) interface{}

params keys

  • name
  • p_code
  • parent_id

func (*Client) PostUser

func (c *Client) PostUser(params interface{}) interface{}

params keys

  • username
  • email
  • role_id
  • last_name
  • first_name
  • employee_id
  • slack_member_id

func (*Client) Put

func (c *Client) Put(endpoint string, params map[string]string) []byte

func (*Client) PutDepartment

func (c *Client) PutDepartment(deartId string, params map[string]string) interface{}

params keys

  • name
  • dept_code
  • detail
  • parent_id

func (*Client) PutPosition

func (c *Client) PutPosition(posId string, params map[string]string) interface{}

params keys

  • name
  • p_code
  • parent_id

func (*Client) PutUser

func (c *Client) PutUser(userId string, params interface{}) interface{}

params keys

  • role_id
  • last_name
  • first_name
  • employee_id
  • slack_member_id

func (*Client) PutUserStatus

func (c *Client) PutUserStatus(userId string, params map[string]string) interface{}

params keys

  • status

func (*Client) RequestByForm

func (c *Client) RequestByForm(method, endpoint string, params map[string]string) []byte

func (*Client) RequestForm

func (c *Client) RequestForm(wfsId string) interface{}

func (*Client) SubmitForm

func (c *Client) SubmitForm(params interface{}) interface{}

params keys

  • comment
  • submit_status
  • t_todo_task_detail
  • wfs_id
  • request_form

func (*Client) UploadFile

func (c *Client) UploadFile(params map[string]string) interface{}

params keys

  • file: string
  • wfs_id
  • id
  • element_id

type DataAuth

type DataAuth struct {
	Message string `json:"message"`
	Data    Auth   `json:"data"`
}

type DataResp

type DataResp struct {
	Message string `json:"message"`

	Data map[string]interface{} `json:"data"`
}

type DataReturn

type DataReturn struct {
	WfsID    int64      `json:"wfs_id"`
	Sections []Sections `json:"sections"`
}

Application for dayoff

type Element

type Element struct {
	Id             int    `json:"id"`
	ElementID      string `json:"element_id"`
	Value          string `json:"value"`
	IsTable        bool   `json:"is_table"`
	MElementTypeID int    `json:"m_element_type_id"`
	Label          string `json:"label"`
}

type Elements

type Elements struct {
	ID             string         `json:"id"`
	ElementID      string         `json:"element_id"`
	Value          string         `json:"value"`
	IsTable        bool           `json:"is_table"`
	MElementTypeID int            `json:"m_element_type_id"`
	TableRowData   []TableRowData `json:"table_row_data"`
}

type ErrorDetail

type ErrorDetail struct {
	Code       int    `json:"code"`
	Message    string `json:"message"`
	Suggestion string `json:"suggestion"`
}

type Http

type Http interface {
	Get()
	Post()
	Put()
	Delete()
	PostLogin()
}

type MUserDeptPositions

type MUserDeptPositions struct {
	PosID  string `json:"pos_id"`
	DeptID string `json:"dept_id"`
}

type RequestForm

type RequestForm struct {
	Title    string     `json:"title"`
	Elements []Elements `json:"elements"`
}

type Sections

type Sections struct {
	ID            int64     `json:"id"`
	Name          string    `json:"name"`
	MFormDetailId int64     `json:"m_form_detail_id:"`
	IsTable       bool      `json:"is_table"`
	HelpText      string    `json:"help_text"`
	Element       []Element `json:"element"`
}

type TableRowData

type TableRowData struct {
	ElementID string `json:"element_id"`
	Value     int    `json:"value"`
}

type User

type User struct {
	Username           string               `json:"username"`
	Email              string               `json:"email"`
	RoleID             string               `json:"role_id"`
	LastName           string               `json:"last_name"`
	FirstName          string               `json:"first_name"`
	EmployeeID         string               `json:"employee_id"`
	SlackMemberID      string               `json:"slack_member_id"`
	MUserDeptPositions []MUserDeptPositions `json:"m_user_dept_positions"`
}

Jump to

Keyboard shortcuts

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