-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package v1 | ||
|
||
import ( | ||
"github.com/gogf/gf/v2/frame/g" | ||
"github.com/oldme-git/oldme-api/internal/model/entity" | ||
) | ||
|
||
type ( | ||
ReadingReq struct { | ||
g.Meta `path:"reading" method:"get" sm:"查询阅读列表" tags:"reading"` | ||
} | ||
|
||
ReadingRes struct { | ||
List []entity.Reading `json:"list"` | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// ================================================================================= | ||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. | ||
// ================================================================================= | ||
|
||
package reading |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// ================================================================================= | ||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. | ||
// ================================================================================= | ||
|
||
package reading | ||
|
||
import ( | ||
"github.com/oldme-git/oldme-api/api/reading" | ||
) | ||
|
||
type ControllerV1 struct{} | ||
|
||
func NewV1() reading.IReadingV1 { | ||
return &ControllerV1{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package reading | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/oldme-git/oldme-api/internal/logic/reading" | ||
|
||
"github.com/oldme-git/oldme-api/api/reading/v1" | ||
) | ||
|
||
func (c *ControllerV1) Reading(ctx context.Context, req *v1.ReadingReq) (res *v1.ReadingRes, err error) { | ||
list, err := reading.List(ctx) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &v1.ReadingRes{ | ||
List: list, | ||
}, nil | ||
} |