mirror of
				https://github.com/gitbucket/gitbucket.git
				synced 2025-10-31 18:46:28 +01:00 
			
		
		
		
	Start to implement issue labels.
This commit is contained in:
		| @@ -12,6 +12,7 @@ class ScalatraBootstrap extends LifeCycle { | ||||
|     context.mount(new RepositoryViewerController, "/*") | ||||
|     context.mount(new WikiController, "/*") | ||||
|     context.mount(new IssuesController, "/*") | ||||
|     context.mount(new LabelsController, "/*") | ||||
|     context.mount(new MilestonesController, "/*") | ||||
|     context.mount(new SettingsController, "/*") | ||||
|      | ||||
|   | ||||
							
								
								
									
										7
									
								
								src/main/scala/app/LabelsController.scala
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								src/main/scala/app/LabelsController.scala
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| package app | ||||
|  | ||||
| class LabelsController extends LabelsControllerBase | ||||
|  | ||||
| trait LabelsControllerBase extends ControllerBase { | ||||
|  | ||||
| } | ||||
							
								
								
									
										19
									
								
								src/main/scala/service/LabelsService.scala
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								src/main/scala/service/LabelsService.scala
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | ||||
| package service | ||||
|  | ||||
| import scala.slick.driver.H2Driver.simple._ | ||||
| import Database.threadLocalSession | ||||
| import scala.slick.jdbc.{StaticQuery => Q} | ||||
| import Q.interpolation | ||||
|  | ||||
| import model._ | ||||
| import Labels._ | ||||
|  | ||||
| trait LabelsService { | ||||
|  | ||||
|   def getLabels(owner: String, repository: String): List[Label] = | ||||
|     Query(Labels) | ||||
|       .filter(l => (l.userName is owner.bind) && (l.repositoryName is repository.bind)) | ||||
|       .sortBy(_.labelName asc) | ||||
|       .list | ||||
|  | ||||
| } | ||||
		Reference in New Issue
	
	Block a user