KN4CK3R
a35749893b
Move `convert` package to services ( #22264 )
...
Addition to #22256
The `convert` package relies heavily on different models which is
[disallowed by our definition of
modules](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#design-guideline ).
This helps to prevent possible import cycles.
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago
flynnnnnnnnnn
e81ccc406b
Implement FSFE REUSE for golang files ( #21840 )
...
Change all license headers to comply with REUSE specification.
Fix #16132
Co-authored-by: flynnnnnnnnnn <flynnnnnnnnnn@github>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2 years ago
KN4CK3R
044c754ea5
Add `context.Context` to more methods ( #21546 )
...
This PR adds a context parameter to a bunch of methods. Some helper
`xxxCtx()` methods got replaced with the normal name now.
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago
Lunny Xiao
1d8543e7db
Move some files into models' sub packages ( #20262 )
...
* Move some files into models' sub packages
* Move functions
* merge main branch
* Fix check
* fix check
* Fix some tests
* Fix lint
* Fix lint
* Revert lint changes
* Fix error comments
* Fix lint
Co-authored-by: 6543 <6543@obermui.de>
2 years ago
Lunny Xiao
fd7d83ace6
Move almost all functions' parameter db.Engine to context.Context ( #19748 )
...
* Move almost all functions' parameter db.Engine to context.Context
* remove some unnecessary wrap functions
3 years ago
Gusted
c8ec2261a9
Fix sending empty notifications ( #19589 )
...
- Don't send empty notifications on read notifications API.
3 years ago
KN4CK3R
80fd25524e
Renamed ctx.User to ctx.Doer. ( #19161 )
...
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 years ago
eladyn
7a893dab39
ignore missing comment for user notifications ( #18954 )
...
* ignore missing comment for user notifications
* instead fix bug in notifications model
* use local variable instead
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
3 years ago
Gusted
ff2fd08228
Simplify parameter types ( #18006 )
...
Remove repeated type declarations in function definitions.
3 years ago
Lunny Xiao
43bbc54783
Fix 500 when a comment was deleted which has a notification ( #17550 )
...
* Fix 500 when a comment was deleted which has a notification
* Tolerate missing Comment in other places too
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 years ago
Norwin
0ffad31b92
Notifications API: respond with updated notifications ( #17064 )
...
* notifications api: return updated notifications in response
* make generate-swagger
* openapi fix
Co-authored-by: zeripath <art27@cantab.net>
3 years ago
6543
2289580bb7
[API] generalize list header ( #16551 )
...
* Add info about list endpoints to CONTRIBUTING.md
* Let all list endpoints return X-Total-Count header
* Add TODOs for GetCombinedCommitStatusByRef
* Fix models/issue_stopwatch.go
* Rrefactor models.ListDeployKeys
* Introduce helper func and use them for SetLinkHeader related func
3 years ago
6543
f1a810e090
Related refactors to ctx.FormX functions ( #16567 )
...
* use FormTrim if posible
* speedup goGet
* only convert if nessesary
3 years ago
6543
c4d70a0325
Rename ctx.Form() to ctx.FormString() and move code into own file ( #16571 )
...
Followup from #16562 prepare for #16567
* Rename ctx.Form() to ctx.FormString()
* Reimplement FormX func to need less code and cpu cycles
* Move code into own file
3 years ago
Lunny Xiao
33e0b38287
Rename context.Query to context.Form ( #16562 )
3 years ago
6543
b3fbd37e99
[API] expose repo.GetReviewers() & repo.GetAssignees() ( #16168 )
...
* API: expose repo.GetReviewers() & repo.GetAssignees()
* Add tests
* fix unrelated swagger query type
3 years ago
6543
9273601064
Add subject-type filter to list notification API endpoints ( #16177 )
...
Close #15886
3 years ago
6543
4f5ff1ef08
move notification APIFormat ( #13783 )
4 years ago
6543
3f3447a1ea
API: Fix GetQueryBeforeSince ( #13559 )
4 years ago
zeripath
63591016b3
Extend Notifications API and return pinned notifications by default ( #12164 )
...
* Extend notifications API and return pinned notifications in notifications list
Signed-off-by: Andrew Thornton <art27@cantab.net>
* fix swagger
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix swagger again
Signed-off-by: Andrew Thornton <art27@cantab.net>
* fix test
Signed-off-by: Andrew Thornton <art27@cantab.net>
* remove spurious debugs
* as per @6543
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update models/notification.go
* as per @6543
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years ago
Cirno the Strongest
27a6e03906
Remove page size limit comment from swagger ( #11806 )
...
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
5 years ago
SpaWn2KiLl
1f01f53c53
API add/generalize pagination ( #9452 )
...
* paginate results
* fixed deadlock
* prevented breaking change
* updated swagger
* go fmt
* fixed find topic
* go mod tidy
* go mod vendor with go1.13.5
* fixed repo find topics
* fixed unit test
* added Limit method to Engine struct; use engine variable when provided; fixed gitignore
* use ItemsPerPage for default pagesize; fix GetWatchers, getOrgUsersByOrgID and GetStargazers; fix GetAllCommits headers; reverted some changed behaviors
* set Page value on Home route
* improved memory allocations
* fixed response headers
* removed logfiles
* fixed import order
* import order
* improved swagger
* added function to get models.ListOptions from context
* removed pagesize diff on unit test
* fixed imports
* removed unnecessary struct field
* fixed go fmt
* scoped PR
* code improvements
* code improvements
* go mod tidy
* fixed import order
* fixed commit statuses session
* fixed files headers
* fixed headers; added pagination for notifications
* go mod tidy
* go fmt
* removed Private from user search options; added setting.UI.IssuePagingNum as default valeu on repo's issues list
* Apply suggestions from code review
Co-Authored-By: 6543 <6543@obermui.de>
Co-Authored-By: zeripath <art27@cantab.net>
* fixed build error
* CI.restart()
* fixed merge conflicts resolve
* fixed conflicts resolve
* improved FindTrackedTimesOptions.ToOptions() method
* added backwards compatibility on ListReleases request; fixed issue tracked time ToSession
* fixed build error; fixed swagger template
* fixed swagger template
* fixed ListReleases backwards compatibility
* added page to user search route
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
5 years ago
6543
6baa5d7588
[API] Add notification endpoint ( #9488 )
...
* [API] Add notification endpoints
* add func GetNotifications(opts FindNotificationOptions)
* add func (n *Notification) APIFormat()
* add func (nl NotificationList) APIFormat()
* add func (n *Notification) APIURL()
* add func (nl NotificationList) APIFormat()
* add LoadAttributes functions (loadRepo, loadIssue, loadComment, loadUser)
* add func (c *Comment) APIURL()
* add func (issue *Issue) GetLastComment()
* add endpoint GET /notifications
* add endpoint PUT /notifications
* add endpoint GET /repos/{owner}/{repo}/notifications
* add endpoint PUT /repos/{owner}/{repo}/notifications
* add endpoint GET /notifications/threads/{id}
* add endpoint PATCH /notifications/threads/{id}
* Add TEST
* code format
* code format
5 years ago