models

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CREATE_BOARD_ADMIN       = 1
	CREATE_BOARD_TYPE        = 0 /* board */
	CREATE_BOARD_NAME        = "board name"
	CREATE_BOARD_INFO        = "description for this board"
	CREATE_BOARD_ROWS        = 15
	CREATE_BOARD_WIDTH       = 1000
	CREATE_BOARD_USE_CAT     = 1
	CREATE_BOARD_LV_LIST     = 0
	CREATE_BOARD_LV_VIEW     = 0
	CREATE_BOARD_LV_WRITE    = 1 /* 0 is not allowed */
	CREATE_BOARD_LV_COMMENT  = 1 /* 0 is not allowed */
	CREATE_BOARD_LV_DOWNLOAD = 1 /* 0 is not allowed */
	CREATE_BOARD_PT_VIEW     = 0
	CREATE_BOARD_PT_WRITE    = 5
	CREATE_BOARD_PT_COMMENT  = 2
	CREATE_BOARD_PT_DOWNLOAD = -10
)

게시판 생성 시 기본값 정의

View Source
const (
	JWT_EMPTY_TOKEN = -10 + iota
	JWT_NOT_BEARER
	JWT_INVALID_TOKEN
	JWT_NO_CLAIMS
	JWT_NO_UID
)

JWT 오류 코드 정의

View Source
const CREATE_GROUP_ADMIN = 1

그룹 생성 시 기본값 정의

View Source
const EXIF_APERTURE_FACTOR = 100
View Source
const EXIF_EXPOSURE_FACTOR = 1000000
View Source
const FAILED = 0

기본값들 정의

Variables

View Source
var JwtClaimsKey = ContextKey("jwtClaims")

Functions

func Connect

func Connect(cfg *configs.Config) *sql.DB

Types

type AdminBoardLevelPolicy

type AdminBoardLevelPolicy struct {
	Uid   uint             `json:"uid"`
	Admin BoardWriter      `json:"admin"`
	Level BoardActionLevel `json:"level"`
}

게시판 레벨 제한 반환값 정의

type AdminBoardPointPolicy

type AdminBoardPointPolicy struct {
	Uid uint `json:"uid"`
	BoardActionPoint
}

게시판 포인트 정책 반환값 정의

type AdminBoardResult

type AdminBoardResult struct {
	Config BoardConfig `json:"config"`
	Groups []Pair      `json:"groups"`
}

게시판 설정 반환값 정의

type AdminCreateBoardResult

type AdminCreateBoardResult struct {
	Uid     uint   `json:"uid"`
	Type    Board  `json:"type"`
	Name    string `json:"name"`
	Info    string `json:"info"`
	Manager Pair   `json:"manager"`
}

게시판 생성하기 시 반환값 정의

type AdminDashboardItem

type AdminDashboardItem struct {
	Groups  []Pair        `json:"groups"`
	Boards  []Pair        `json:"boards"`
	Members []BoardWriter `json:"members"`
}

대시보드 아이템(그룹, 게시판, 회원 최신순 목록) 반환값 정의

type AdminDashboardLatest

type AdminDashboardLatest struct {
	Posts    []AdminDashboardLatestContent `json:"posts"`
	Comments []AdminDashboardLatestContent `json:"comments"`
	Reports  []AdminDashboardReport        `json:"reports"`
}

대시보드 최근 (댓)글, 신고 목록 최신순 반환값 정의

type AdminDashboardLatestContent

type AdminDashboardLatestContent struct {
	AdminDashboardReport
	Id   string `json:"id"`
	Type Board  `json:"type"`
}

대시보드 최근 (댓)글 목록 반환값 정의

type AdminDashboardReport

type AdminDashboardReport struct {
	Uid     uint        `json:"uid"`
	Content string      `json:"content"`
	Writer  BoardWriter `json:"writer"`
}

대시보드 최근 신고 목록 반환값 정의

type AdminDashboardStatistic

type AdminDashboardStatistic struct {
	History []AdminDashboardStatus `json:"history"`
	Total   uint                   `json:"total"`
}

대시보드 최근 통계 반환값 정의

type AdminDashboardStatisticResult

type AdminDashboardStatisticResult struct {
	Visit  AdminDashboardStatistic `json:"visit"`
	Member AdminDashboardStatistic `json:"member"`
	Post   AdminDashboardStatistic `json:"post"`
	Reply  AdminDashboardStatistic `json:"reply"`
	File   AdminDashboardStatistic `json:"file"`
	Image  AdminDashboardStatistic `json:"image"`
}

대시보드 최근 통계들 반환값 정의

type AdminDashboardStatus

type AdminDashboardStatus struct {
	Date  uint64 `json:"date"`
	Visit uint   `json:"visit"`
}

대시보드 일자별 데이터 반환값 정의

type AdminGroupBoardItem

type AdminGroupBoardItem struct {
	AdminGroupConfig
	Id    string                `json:"id"`
	Type  Board                 `json:"type"`
	Name  string                `json:"name"`
	Info  string                `json:"info"`
	Total AdminGroupBoardStatus `json:"total"`
}

그룹 관리화면 게시판 (및 통계) 목록 반환값 정의

type AdminGroupBoardStatus

type AdminGroupBoardStatus struct {
	Post    uint `json:"post"`
	Comment uint `json:"comment"`
	File    uint `json:"file"`
	Image   uint `json:"image"`
}

게시판 별 간단 통계 반환값 정의

type AdminGroupConfig

type AdminGroupConfig struct {
	Uid     uint        `json:"uid"`
	Id      string      `json:"id"`
	Count   uint        `json:"count"`
	Manager BoardWriter `json:"manager"`
}

그룹 관리화면 일반 설정들 반환값 정의

type AdminGroupListResult

type AdminGroupListResult struct {
	Config AdminGroupConfig      `json:"config"`
	Boards []AdminGroupBoardItem `json:"boards"`
}

그룹 설정 및 소속 게시판들 정보 반환값 정의

type AdminLatestComment

type AdminLatestComment struct {
	AdminLatestCommon
	Content string `json:"content"`
	PostUid uint   `json:"postUid"`
}

최근 댓글 반환값 정의

type AdminLatestCommentResult

type AdminLatestCommentResult struct {
	Comments []AdminLatestComment `json:"comments"`
	MaxUid   uint                 `json:"maxUid"`
}

최근 댓글 및 max uid 반환값 정의

type AdminLatestCommon

type AdminLatestCommon struct {
	Uid    uint        `json:"uid"`
	Id     string      `json:"id"`
	Type   Board       `json:"type"`
	Like   uint        `json:"like"`
	Date   uint64      `json:"date"`
	Status Status      `json:"status"`
	Writer BoardWriter `json:"writer"`
}

최근 (댓)글 출력에 필요한 공통 반환값 정의

type AdminLatestParameter

type AdminLatestParameter struct {
	Page    uint
	Bunch   uint
	MaxUid  uint
	Option  Search
	Keyword string
}

(댓)글 검색하기에 필요한 파라미터 정의

type AdminLatestPost

type AdminLatestPost struct {
	AdminLatestCommon
	Title   string `json:"title"`
	Comment uint   `json:"comment"`
	Hit     uint   `json:"hit"`
}

최근 글 반환값 정의

type AdminLatestPostResult

type AdminLatestPostResult struct {
	Posts  []AdminLatestPost `json:"posts"`
	MaxUid uint              `json:"maxUid"`
}

최근 글 및 max uid 반환값 정의

type AdminReportItem

type AdminReportItem struct {
	To       BoardWriter `json:"to"`
	From     BoardWriter `json:"from"`
	Request  string      `json:"request"`
	Response string      `json:"response"`
	Date     uint64      `json:"date"`
}

신고 목록 반환값 정의

type AdminReportParameter

type AdminReportParameter struct {
	AdminLatestParameter
	IsSolved bool
}

신고 목록 검색하기에 필요한 파라미터 정의

type AdminReportResult

type AdminReportResult struct {
	Reports []AdminReportItem `json:"reports"`
	MaxUid  uint              `json:"maxUid"`
}

신고 목록 및 max uid 반환값 정의

type AdminUserInfo

type AdminUserInfo struct {
	BoardWriter
	Id    string `json:"id"`
	Level uint   `json:"level"`
	Point uint   `json:"point"`
}

사용자 정보 반환값 정의

type AdminUserItem

type AdminUserItem struct {
	UserBasicInfo
	Id     string `json:"id"`
	Level  uint   `json:"level"`
	Point  uint   `json:"point"`
	Signup uint64 `json:"signup"`
}

사용자 목록 검색하기 반환값 정의

type AdminUserItemResult

type AdminUserItemResult struct {
	User   []AdminUserItem `json:"user"`
	MaxUid uint            `json:"maxUid"`
}

사용자 목록 검색 결과 및 max uid 반환값 정의

type AdminUserParameter

type AdminUserParameter struct {
	AdminLatestParameter
	IsBlocked bool
}

사용자 목록 검색하기에 필요한 파라미터 정의

type Board

type Board uint8

게시판 타입 정의

const (
	BOARD_DEFAULT Board = iota
	BOARD_GALLERY
	BOARD_BLOG
	BOARD_WEBZINE
	BOARD_SHOP
)

게시판 타입 목록

func (Board) String

func (b Board) String() string

type BoardAction

type BoardAction uint

게시판 관련 액션 정의

const (
	BOARD_ACTION_LIST BoardAction = iota
	BOARD_ACTION_VIEW
	BOARD_ACTION_COMMENT
	BOARD_ACTION_WRITE
	BOARD_ACTION_DOWNLOAD
)

게시판 관련 액션들

func (BoardAction) String

func (ba BoardAction) String() string

게시판 액션들 문자로 변환

type BoardActionLevel

type BoardActionLevel struct {
	BoardActionPoint
	List int `json:"list"`
}

활동별로 필요한 레벨 정의

type BoardActionPoint

type BoardActionPoint struct {
	View     int `json:"view"`
	Write    int `json:"write"`
	Comment  int `json:"comment"`
	Download int `json:"download"`
}

활동별로 필요한 포인트 정의

type BoardAttachedImage

type BoardAttachedImage struct {
	File        BoardFile      `json:"file"`
	Thumbnail   BoardThumbnail `json:"thumbnail"`
	Exif        BoardExif      `json:"exif"`
	Description string         `json:"description"`
}

게시판 첨부 이미지 구조체 정의

type BoardAttachment

type BoardAttachment struct {
	Pair
	Size uint `json:"size"`
}

게시판 첨부파일 구조체 정의

type BoardBasicConfig

type BoardBasicConfig struct {
	Id   string `json:"id"`
	Type Board  `json:"type"`
	Name string `json:"name"`
}

게시글 작성자의 최근 글/댓글에 전달할 게시판 기본 설정값 정의

type BoardBasicSettingResult

type BoardBasicSettingResult struct {
	Id          string
	Type        Board
	UseCategory bool
}

게시판 기본 설정값들 반환 타입 정의

type BoardCommonListItem

type BoardCommonListItem struct {
	Category Pair        `json:"category"`
	Cover    string      `json:"cover"`
	Comment  uint        `json:"comment"`
	Like     uint        `json:"like"`
	Liked    bool        `json:"liked"`
	Writer   BoardWriter `json:"writer"`
}

게시글 목록보기에 추가로 필요한 리턴 타입 정의

type BoardCommonPostItem

type BoardCommonPostItem struct {
	Uid       uint   `json:"uid"`
	Title     string `json:"title"`
	Content   string `json:"content"`
	Submitted uint64 `json:"submitted"`
	Modified  uint64 `json:"modified"`
	Hit       uint   `json:"hit"`
	Status    Status `json:"status"`
}

홈화면 게시글 공통 리턴 타입 정의

type BoardConfig

type BoardConfig struct {
	Uid      uint   `json:"uid"`
	Id       string `json:"id"`
	GroupUid uint   `json:"groupUid"`
	Admin    struct {
		Group uint `json:"group"`
		Board uint `json:"board"`
	} `json:"admin"`
	Type        Board            `json:"type"`
	Name        string           `json:"name"`
	Info        string           `json:"info"`
	RowCount    uint             `json:"rowCount"`
	Width       uint             `json:"width"`
	UseCategory bool             `json:"useCategory"`
	Category    []Pair           `json:"category"`
	Level       BoardActionLevel `json:"level"`
	Point       BoardActionPoint `json:"point"`
}

게시판 설정 타입 정의

type BoardExif

type BoardExif struct {
	Make        string `json:"make"`
	Model       string `json:"model"`
	Aperture    uint   `json:"aperture"`
	ISO         uint   `json:"iso"`
	FocalLength uint   `json:"focalLength"`
	Exposure    uint   `json:"exposure"`
	Width       uint   `json:"width"`
	Height      uint   `json:"height"`
	Date        uint64 `json:"date"`
}

EXIF 구조체 정의

type BoardFile

type BoardFile struct {
	Uid  uint   `json:"uid"`
	Path string `json:"path"`
}

파일 기본 구조 정의

type BoardHomePostItem

type BoardHomePostItem struct {
	BoardCommonPostItem
	BoardCommonListItem
	Id          string `json:"id"`
	Type        Board  `json:"type"`
	UseCategory bool   `json:"useCategory"`
}

최근 게시글들 최종 리턴 타입 정의

type BoardHomePostResult

type BoardHomePostResult struct {
	Items  []BoardHomePostItem `json:"items"`
	Config BoardConfig         `json:"config"`
}

최근 게시글들 최종 리턴 타입 및 게시판 정보 정의

type BoardItem

type BoardItem struct {
	Pair
	Info string `json:"info"`
}

게시글 이동에 필요한 게시판 목록 타입 정의

type BoardListItem

type BoardListItem struct {
	BoardCommonPostItem
	BoardCommonListItem
}

게시글 목록보기용 리턴 타입 정의

type BoardListParameter

type BoardListParameter struct {
	HomePostParameter
	Page        uint
	Direction   Paging
	NoticeCount uint
}

게시글 가져오기 시 필요한 파라미터 정의

type BoardListResult

type BoardListResult struct {
	TotalPostCount uint            `json:"totalPostCount"`
	Config         BoardConfig     `json:"config"`
	Notices        []BoardListItem `json:"notices"`
	Posts          []BoardListItem `json:"posts"`
	BlackList      []uint          `json:"blackList"`
	IsAdmin        bool            `json:"isAdmin"`
}

게시글 목록보기 리턴 값 정의

type BoardMovePostParameter

type BoardMovePostParameter struct {
	BoardViewCommonParameter
	TargetBoardUid uint
}

게시글 이동에 필요한 파라미터 정의

type BoardThumbnail

type BoardThumbnail struct {
	Large string `json:"large"`
	Small string `json:"small"`
}

썸네일 크기별 종류 정의

type BoardViewCommonParameter

type BoardViewCommonParameter struct {
	BoardUid uint
	PostUid  uint
	UserUid  uint
}

게시글 보기에서 공통으로 쓰이는 파라미터 정의

type BoardViewDownloadResult

type BoardViewDownloadResult struct {
	Name string `json:"name"`
	Path string `json:"path"`
}

첨부파일 다운로드 결과 정의

type BoardViewLikeParameter

type BoardViewLikeParameter struct {
	BoardViewCommonParameter
	Liked bool
}

게시글 좋아하기에 필요한 파라미터 정의

type BoardViewParameter

type BoardViewParameter struct {
	BoardViewCommonParameter
	UpdateHit bool
	Limit     uint
}

게시글 보기에 필요한 파라미터 정의

type BoardViewResult

type BoardViewResult struct {
	Config         BoardConfig                `json:"config"`
	Post           BoardListItem              `json:"post"`
	Images         []BoardAttachedImage       `json:"images"`
	Files          []BoardAttachment          `json:"files"`
	Tags           []Pair                     `json:"tags"`
	PrevPostUid    uint                       `json:"prevPostUid"`
	NextPostUid    uint                       `json:"nextPostUid"`
	WriterPosts    []BoardWriterLatestPost    `json:"writerPosts"`
	WriterComments []BoardWriterLatestComment `json:"writerComments"`
}

게시글 보기에 반환 타입 정의

type BoardWriter

type BoardWriter struct {
	UserBasicInfo
	Signature string `json:"signature"`
}

게시글 작성자 타입 정의

type BoardWriterLatestComment

type BoardWriterLatestComment struct {
	BoardWriterLatestCommon
	Content string `json:"content"`
}

게시글 작성자의 최근 댓글 정의

type BoardWriterLatestCommon

type BoardWriterLatestCommon struct {
	Board     BoardBasicConfig `json:"board"`
	PostUid   uint             `json:"postUid"`
	Like      uint             `json:"like"`
	Submitted uint             `json:"submitted"`
}

게시글 작성자의 최근 글/댓글 공통 요소 정의

type BoardWriterLatestPost

type BoardWriterLatestPost struct {
	BoardWriterLatestCommon
	Comment uint   `json:"comment"`
	Title   string `json:"title"`
}

게시글 작성자의 최근 글 정의

type ChangeUserPointParameter

type ChangeUserPointParameter struct {
	BoardUid uint
	UserUid  uint
	Action   PointAction
}

사용자의 포인트 변경하기에 필요한 파라미터 정의

type ChatHistory

type ChatHistory struct {
	Uid       uint   `json:"uid"`
	UserUid   uint   `json:"userUid"`
	Message   string `json:"message"`
	Timestamp uint64 `json:"timestamp"`
}

쪽지 내용 보기용 정보

type ChatItem

type ChatItem struct {
	Sender    UserBasicInfo `json:"sender"`
	Uid       uint          `json:"uid"`
	Message   string        `json:"message"`
	Timestamp uint64        `json:"timestamp"`
}

쪽지 목록용 정보

type Code added in v1.0.2

type Code uint

에러 코드 정의

const (
	CODE_SUCCESS Code = iota
	CODE_NOT_ADMIN
	CODE_INVALID_TOKEN
	CODE_INVALID_PARAMETER
	CODE_FAILED_OPERATION
	CODE_DUPLICATED_VALUE
	CODE_NO_PERMISSION
	CODE_EXCEED_SIZE
	CODE_EXPIRED_TOKEN
)

에러 타입 상수 정의

type CommentItem

type CommentItem struct {
	Uid       uint        `json:"uid"`
	ReplyUid  uint        `json:"replyUid"`
	PostUid   uint        `json:"postUid"`
	Writer    BoardWriter `json:"writer"`
	Like      uint        `json:"like"`
	Liked     bool        `json:"liked"`
	Submitted uint64      `json:"submitted"`
	Modified  uint64      `json:"modified"`
	Status    Status      `json:"status"`
	Content   string      `json:"content"`
}

댓글 내용 항목 정의

type CommentLikeParameter

type CommentLikeParameter struct {
	BoardUid   uint
	CommentUid uint
	UserUid    uint
	Liked      bool
}

댓글에 좋아요 처리에 필요한 파라미터 정의

type CommentListParameter

type CommentListParameter struct {
	BoardUid  uint
	PostUid   uint
	UserUid   uint
	Page      uint
	Bunch     uint
	SinceUid  uint
	Direction Paging
}

댓글 목록 가져오기에 필요한 파라미터 정의

type CommentListResult

type CommentListResult struct {
	BoardUid          uint          `json:"boardUid"`
	SinceUid          uint          `json:"sinceUid"`
	TotalCommentCount uint          `json:"totalCommentCount"`
	Comments          []CommentItem `json:"comments"`
}

댓글 목록 가져오기 결과 정의

type CommentModifyParameter

type CommentModifyParameter struct {
	CommentWriteParameter
	CommentUid uint
}

댓글 수정하기에 필요한 파라미터 정의

type CommentReplyParameter

type CommentReplyParameter struct {
	CommentWriteParameter
	ReplyTargetUid uint
}

답글 작성하기에 필요한 파라미터 정의

type CommentWriteParameter

type CommentWriteParameter struct {
	BoardUid uint
	PostUid  uint
	UserUid  uint
	Content  string
}

새 댓글 작성하기에 필요한 파라미터 정의

type ContextKey

type ContextKey string

JWT 컨텍스트 키값 설정

type EditorConfigResult

type EditorConfigResult struct {
	Config     BoardConfig `json:"config"`
	IsAdmin    bool        `json:"isAdmin"`
	Categories []Pair      `json:"categories"`
}

에디터에서 게시판 설정 및 카테고리 불러오기 결과 타입 정의

type EditorInsertImageParameter

type EditorInsertImageParameter struct {
	BoardUid uint
	LastUid  uint
	UserUid  uint
	Bunch    uint
}

게시글에 삽입한 이미지 목록 가져오는 파라미터 정의

type EditorInsertImageResult

type EditorInsertImageResult struct {
	Images          []Pair `json:"images"`
	MaxImageUid     uint   `json:"maxImageUid"`
	TotalImageCount uint   `json:"totalImageCount"`
}

게시글에 삽입한 이미지 목록 반환 타입 정의

type EditorLoadPostResult

type EditorLoadPostResult struct {
	Post  BoardListItem     `json:"post"`
	Files []BoardAttachment `json:"files"`
	Tags  []Pair            `json:"tags"`
}

게시글 수정 시 가져오는 정보들 반환 타입 정의

type EditorModifyParameter

type EditorModifyParameter struct {
	EditorWriteParameter
	PostUid uint
}

게시글 수정 시 필요한 파라미터 정의

type EditorRemoveAttachedParameter

type EditorRemoveAttachedParameter struct {
	BoardUid uint
	PostUid  uint
	FileUid  uint
	UserUid  uint
}

게시글 수정 시 첨부된 파일 삭제하기에 필요한 파라미터 정의

type EditorSaveExifParameter

type EditorSaveExifParameter struct {
	BoardExif
	FileUid uint
	PostUid uint
}

EXIF 저장할 때 필요한 파라미터 정의

type EditorSaveFileParameter

type EditorSaveFileParameter struct {
	BoardUid uint
	PostUid  uint
	Name     string
	Path     string
}

첨부파일 저장할 때 필요한 파라미터 정의

type EditorSaveThumbnailParameter

type EditorSaveThumbnailParameter struct {
	BoardThumbnail
	FileUid uint
	PostUid uint
}

썸네일 이미지 저장할 때 필요한 파라미터 정의

type EditorTagItem

type EditorTagItem struct {
	Pair
	Count uint `json:"count"`
}

태그 자동완성 결과 타입 정의

type EditorWriteParameter

type EditorWriteParameter struct {
	BoardUid    uint
	UserUid     uint
	CategoryUid uint
	Title       string
	Content     string
	Files       []*multipart.FileHeader
	Tags        []string
	IsNotice    bool
	IsSecret    bool
}

게시글 작성 시 필요한 파라미터 정의

type GalleryGridItem

type GalleryGridItem struct {
	Uid     uint                 `json:"uid"`
	Like    uint                 `json:"like"`
	Liked   bool                 `json:"liked"`
	Writer  BoardWriter          `json:"writer"`
	Comment uint                 `json:"comment"`
	Title   string               `json:"title"`
	Images  []BoardAttachedImage `json:"images"`
}

갤러리 그리드형 반환타입 정의

type GalleryListResult

type GalleryListResult struct {
	Config         BoardConfig       `json:"config"`
	Images         []GalleryGridItem `json:"images"`
	TotalPostCount uint              `json:"totalPostCount"`
}

갤러리 리스트 반환 타입 정의

type GalleryPhotoResult

type GalleryPhotoResult struct {
	Config BoardConfig          `json:"config"`
	Images []BoardAttachedImage `json:"images"`
}

갤러리 사진 보기 반환 타입 정의

type GoogleUser

type GoogleUser struct {
	ID      string `json:"id"`
	Email   string `json:"email"`
	Name    string `json:"name"`
	Picture string `json:"picture"`
}

구글 OAuth 응답

type HomeMainArticle

type HomeMainArticle struct {
	Cover    string
	Content  template.HTML
	Comments []HomeMainComment
	Date     string
	Hashtags []Pair
	Like     uint
	Name     string
	Title    string
	Url      string
}

SEO 메인화면에 보여줄 article 구조체 정의

type HomeMainComment

type HomeMainComment struct {
	Content template.HTML
	Date    string
	Like    uint
	Name    string
}

SEO 메인화면에 보여줄 댓글 구조체 정의

type HomeMainPage

type HomeMainPage struct {
	PageTitle string
	PageUrl   string
	Version   string
	Articles  []HomeMainArticle
}

SEO 메인화면에 출력할 구조체 정의

type HomePostItem

type HomePostItem struct {
	BoardCommonPostItem
	BoardUid    uint `json:"boardUid"`
	UserUid     uint `json:"userUid"`
	CategoryUid uint `json:"categoryUid"`
}

최근 게시글 리턴 타입 정의

type HomePostParameter

type HomePostParameter struct {
	SinceUid uint
	Bunch    uint
	Option   Search
	Keyword  string
	UserUid  uint
	BoardUid uint
}

최근 게시글 가져올 때 필요한 파라미터 정의

type HomeSidebarBoardResult

type HomeSidebarBoardResult struct {
	Id   string `json:"id"`
	Type Board  `json:"type"`
	Name string `json:"name"`
	Info string `json:"info"`
}

홈 사이드바에 출력할 게시판 목록 형태 정의

type HomeSidebarGroupResult

type HomeSidebarGroupResult struct {
	Group  string                   `json:"group"`
	Boards []HomeSidebarBoardResult `json:"boards"`
}

홈 사이드바에 출력할 그룹 목록 형태 정의

type HomeSitemapURL

type HomeSitemapURL struct {
	Loc        string
	LastMod    string
	ChangeFreq string
	Priority   string
}

사이트맵 구조체 정의

type HomeVisitResult

type HomeVisitResult struct {
	Success         bool   `json:"success"`
	OfficialWebsite string `json:"officialWebsite"`
	Version         string `json:"version"`
	License         string `json:"license"`
	Github          string `json:"github"`
}

버전 응답 구조체

type InsertNotificationParameter

type InsertNotificationParameter struct {
	ActionUserUid uint
	TargetUserUid uint
	NotiType      Noti
	PostUid       uint
	CommentUid    uint
}

새 알림 추가 파라미터 정의

type KakaoUser

type KakaoUser struct {
	ID           int64 `json:"id"`
	KakaoAccount struct {
		Email   string `json:"email"`
		Profile struct {
			Nickname        string `json:"nickname"`
			ProfileImageUrl string `json:"profile_image_url"`
		} `json:"profile"`
	} `json:"kakao_account"`
}

카카오 OAuth 응답

type MyInfoResult

type MyInfoResult struct {
	UserInfoResult
	Id      string `json:"id"`
	Point   uint   `json:"point"`
	Token   string `json:"token"`
	Refresh string `json:"refresh"`
}

(로그인 한) 내 정보

type NaverUser struct {
	Response struct {
		Email        string `json:"email"`
		Nickname     string `json:"nickname"`
		ProfileImage string `json:"profile_image"`
	} `json:"response"`
}

네이버 OAuth 응답

type Noti

type Noti uint8

알림 타입 재정의

const (
	NOTI_LIKE_POST Noti = iota
	NOTI_LIKE_COMMENT
	NOTI_LEAVE_COMMENT
	NOTI_REPLY_COMMENT
	NOTI_CHAT_MESSAGE
)

알림 타입 고유값들

type NotificationItem

type NotificationItem struct {
	Uid       uint          `json:"uid"`
	FromUser  UserBasicInfo `json:"fromUser"`
	Type      Noti          `json:"type"`
	Id        string        `json:"id"`
	BoardType Board         `json:"boardType"`
	PostUid   uint          `json:"postUid"`
	Checked   bool          `json:"checked"`
	Timestamp uint64        `json:"timestamp"`
}

알림내용 조회 항목 정의

type Paging

type Paging int8

게시판 목록 페이징 이동 방향 정의

const (
	PAGE_PREV Paging = -1
	PAGE_NEXT Paging = 1
)

func (Paging) Query

func (p Paging) Query() (string, string)

페이징 방향 반환 시 쿼리에 사용할 문자열 반환

type Pair

type Pair struct {
	Uid  uint   `json:"uid"`
	Name string `json:"name"`
}

고유값과 이름 구조체 정의

type PointAction

type PointAction uint

사용자 포인트 변경 이력 타입 정의

const (
	POINT_ACTION_VIEW PointAction = iota
	POINT_ACTION_WRITE
	POINT_ACTION_COMMENT
	POINT_ACTION_DOWNLOAD
)

포인트 변경 액션들

func (PointAction) String

func (pa PointAction) String() string

포인트 변경 액션 이름 반환

type ResetPasswordResult

type ResetPasswordResult struct {
	Sendmail bool `json:"sendmail"`
}

비밀번호 초기화 시 리턴 타입

type ResponseCommon

type ResponseCommon struct {
	Success bool        `json:"success"`
	Error   string      `json:"error"`
	Code    Code        `json:"code"`
	Result  interface{} `json:"result"`
}

가장 기본적인 서버 응답

type Search uint8

검색 옵션 정의

const (
	SEARCH_TITLE Search = iota
	SEARCH_CONTENT
	SEARCH_WRITER
	SEARCH_TAG
	SEARCH_CATEGORY
	SEARCH_REPORT_TO
	SEARCH_REPORT_FROM
	SEARCH_REPORT_REQUEST
	SEARCH_REPORT_RESPONSE
	SEARCH_USER_NAME
	SEARCH_USER_ID
	SEARCH_USER_LEVEL
	SEARCH_NONE
)

검색 옵션들

func (Search) String

func (s Search) String() string

type SignupParameter

type SignupParameter struct {
	ID       string
	Password string
	Name     string
	Hostname string
}

인증 메일 발송에 필요한 파라미터 정의

type SignupResult

type SignupResult struct {
	Sendmail bool `json:"sendmail"`
	Target   uint `json:"target"`
}

회원가입 시 리턴 타입

type StatisticColumn

type StatisticColumn uint8

대시보드 통계 추출 시 필요한 컬럼 타입 정의

const (
	COLUMN_TIMESTAMP StatisticColumn = iota
	COLUMN_SIGNUP
	COLUMN_SUBMITTED
)

통계용 컬럼 타입 목록

func (StatisticColumn) String

func (s StatisticColumn) String() string

type Status

type Status int8

게시글 상태 정의

const (
	CONTENT_REMOVED Status = -1 + iota
	CONTENT_NORMAL
	CONTENT_NOTICE
	CONTENT_SECRET
)

게시글 상태들

type SyncImageItem

type SyncImageItem struct {
	Uid   uint      `json:"uid"`
	File  string    `json:"file"`
	Name  string    `json:"name"`
	Thumb string    `json:"thumb"`
	Full  string    `json:"full"`
	Desc  string    `json:"desc"`
	Exif  BoardExif `json:"exif"`
}

첨부 파일 및 이미지 썸네일 반환 타입 정의

type SyncPostItem

type SyncPostItem struct {
	Id        string          `json:"id"`
	No        uint            `json:"no"`
	Title     string          `json:"title"`
	Content   string          `json:"content"`
	Submitted uint64          `json:"submitted"`
	Name      string          `json:"name"`
	Tags      []string        `json:"tags"`
	Images    []SyncImageItem `json:"images"`
}

동기화 시킬 데이터 결과 타입 정의

type Table

type Table string

게시판 테이블 정의

const (
	TABLE_BOARD         Table = "board"
	TABLE_BOARD_CAT     Table = "board_category"
	TABLE_CHAT          Table = "chat"
	TABLE_COMMENT       Table = "comment"
	TABLE_COMMENT_LIKE  Table = "comment_like"
	TABLE_EXIF          Table = "exif"
	TABLE_FILE          Table = "file"
	TABLE_FILE_THUMB    Table = "file_thumbnail"
	TABLE_GROUP         Table = "group"
	TABLE_HASHTAG       Table = "hashtag"
	TABLE_IMAGE         Table = "image"
	TABLE_IMAGE_DESC    Table = "image_description"
	TABLE_NOTI          Table = "notification"
	TABLE_POINT_HISTORY Table = "point_history"
	TABLE_POST          Table = "post"
	TABLE_POST_HASHTAG  Table = "post_hashtag"
	TABLE_POST_LIKE     Table = "post_like"
	TABLE_REPORT        Table = "report"
	TABLE_USER          Table = "user"
	TABLE_USER_ACCESS   Table = "user_access_log"
	TABLE_USER_BLOCK    Table = "user_black_list"
	TABLE_USER_PERM     Table = "user_permission"
	TABLE_USER_TOKEN    Table = "user_token"
	TABLE_USER_VERIFY   Table = "user_verification"
)

게시판 테이블 이름들 정리

type Triple

type Triple struct {
	Pair
	Id string `json:"id"`
}

uid, id, name 3개를 담는 구조체

type UpdatePointParameter

type UpdatePointParameter struct {
	UserUid  uint
	BoardUid uint
	Action   PointAction
	Point    int
}

포인트 변경 파라미터 정의

type UpdateUserInfoParameter

type UpdateUserInfoParameter struct {
	UserUid    uint
	Name       string
	Signature  string
	Password   string
	Profile    *multipart.FileHeader
	OldProfile string
}

내 정보 수정하기 파라미터 정의

type UploadCategory

type UploadCategory string

업로드 폴더의 하위 폴더들

const (
	UPLOAD_ATTACH  UploadCategory = "attachments"
	UPLOAD_IMAGE   UploadCategory = "images"
	UPLOAD_PROFILE UploadCategory = "profile"
	UPLOAD_TEMP    UploadCategory = "temp"
	UPLOAD_THUMB   UploadCategory = "thumbnails"
)

하위 폴더들의 상수 정의

type UserAction

type UserAction uint8

액션 타입 재정의

const (
	USER_ACTION_WRITE_POST UserAction = iota
	USER_ACTION_WRITE_COMMENT
	USER_ACTION_SEND_CHAT
	USER_ACTION_SEND_REPORT
)

액션 고유 값들

func (UserAction) String

func (a UserAction) String() string

액션 이름 반환

type UserBasicInfo

type UserBasicInfo struct {
	UserUid uint   `json:"uid"`
	Name    string `json:"name"`
	Profile string `json:"profile"`
}

사용자의 최소 기본 정보들

type UserInfoResult

type UserInfoResult struct {
	Uid       uint   `json:"uid"`
	Name      string `json:"name"`
	Profile   string `json:"profile"`
	Level     uint   `json:"level"`
	Signature string `json:"signature"`
	Signup    uint64 `json:"signup"`
	Signin    uint64 `json:"signin"`
	Admin     bool   `json:"admin"`
	Blocked   bool   `json:"blocked"`
}

(공개된) 사용자 정보

type UserPermissionReportResult

type UserPermissionReportResult struct {
	UserPermissionResult
	Login    bool   `json:"login"`
	UserUid  uint   `json:"userUid"`
	Response string `json:"response"`
}

사용자 권한 및 로그인, 신고 내역 정의

type UserPermissionResult

type UserPermissionResult struct {
	WritePost       bool `json:"writePost"`
	WriteComment    bool `json:"writeComment"`
	SendChatMessage bool `json:"sendChatMessage"`
	SendReport      bool `json:"sendReport"`
}

사용자의 권한 정보들

type VerifyParameter

type VerifyParameter struct {
	Target   uint
	Code     string
	Id       string
	Password string
	Name     string
}

인증 완료하기 파라미터

Jump to

Keyboard shortcuts

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