MCPcopy
hub / github.com/eyebluecn/tank / Page

Method Page

code/rest/image_cache_controller.go:63–114  ·  view source on GitHub ↗
(writer http.ResponseWriter, request *http.Request)

Source from the content-addressed store, hash-verified

61}
62
63func (this *ImageCacheController) Page(writer http.ResponseWriter, request *http.Request) *result.WebResult {
64
65 pageStr := request.FormValue("page")
66 pageSizeStr := request.FormValue("pageSize")
67 orderCreateTime := request.FormValue("orderCreateTime")
68 orderUpdateTime := request.FormValue("orderUpdateTime")
69 orderSort := request.FormValue("orderSort")
70
71 userUuid := request.FormValue("userUuid")
72 matterUuid := request.FormValue("matterUuid")
73 orderSize := request.FormValue("orderSize")
74
75 user := this.checkUser(request)
76 userUuid = user.Uuid
77
78 var page int
79 if pageStr != "" {
80 page, _ = strconv.Atoi(pageStr)
81 }
82
83 pageSize := 200
84 if pageSizeStr != "" {
85 tmp, err := strconv.Atoi(pageSizeStr)
86 if err == nil {
87 pageSize = tmp
88 }
89 }
90
91 sortArray := []builder.OrderPair{
92 {
93 Key: "create_time",
94 Value: orderCreateTime,
95 },
96 {
97 Key: "update_time",
98 Value: orderUpdateTime,
99 },
100 {
101 Key: "sort",
102 Value: orderSort,
103 },
104
105 {
106 Key: "size",
107 Value: orderSize,
108 },
109 }
110
111 pager := this.imageCacheDao.Page(page, pageSize, userUuid, matterUuid, sortArray)
112
113 return this.Success(pager)
114}
115
116func (this *ImageCacheController) Delete(writer http.ResponseWriter, request *http.Request) *result.WebResult {
117

Callers

nothing calls this directly

Calls 2

checkUserMethod · 0.80
SuccessMethod · 0.80

Tested by

no test coverage detected