├── .gitignore ├── apispec.json ├── app ├── database.go └── router.go ├── controller ├── category_controller.go └── category_controller_impl.go ├── exception ├── error_handler.go └── not_found_error.go ├── go.mod ├── go.sum ├── helper ├── error.go ├── json.go ├── model.go └── tx.go ├── main.go ├── middleware └── auth_middleware.go ├── model ├── domain │ └── category.go └── web │ ├── category_create_request.go │ ├── category_response.go │ ├── category_update_request.go │ └── web_response.go ├── repository ├── category_repository.go └── category_repository_impl.go ├── service ├── category_service.go └── category_service_impl.go ├── test.http └── test └── category_controller_test.go /.gitignore: -------------------------------------------------------------------------------- 1 | .idea -------------------------------------------------------------------------------- /apispec.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/apispec.json -------------------------------------------------------------------------------- /app/database.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/app/database.go -------------------------------------------------------------------------------- /app/router.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/app/router.go -------------------------------------------------------------------------------- /controller/category_controller.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/controller/category_controller.go -------------------------------------------------------------------------------- /controller/category_controller_impl.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/controller/category_controller_impl.go -------------------------------------------------------------------------------- /exception/error_handler.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/exception/error_handler.go -------------------------------------------------------------------------------- /exception/not_found_error.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/exception/not_found_error.go -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/go.mod -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/go.sum -------------------------------------------------------------------------------- /helper/error.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/helper/error.go -------------------------------------------------------------------------------- /helper/json.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/helper/json.go -------------------------------------------------------------------------------- /helper/model.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/helper/model.go -------------------------------------------------------------------------------- /helper/tx.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/helper/tx.go -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/main.go -------------------------------------------------------------------------------- /middleware/auth_middleware.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/middleware/auth_middleware.go -------------------------------------------------------------------------------- /model/domain/category.go: -------------------------------------------------------------------------------- 1 | package domain 2 | 3 | type Category struct { 4 | Id int 5 | Name string 6 | } 7 | -------------------------------------------------------------------------------- /model/web/category_create_request.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/model/web/category_create_request.go -------------------------------------------------------------------------------- /model/web/category_response.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/model/web/category_response.go -------------------------------------------------------------------------------- /model/web/category_update_request.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/model/web/category_update_request.go -------------------------------------------------------------------------------- /model/web/web_response.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/model/web/web_response.go -------------------------------------------------------------------------------- /repository/category_repository.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/repository/category_repository.go -------------------------------------------------------------------------------- /repository/category_repository_impl.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/repository/category_repository_impl.go -------------------------------------------------------------------------------- /service/category_service.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/service/category_service.go -------------------------------------------------------------------------------- /service/category_service_impl.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/service/category_service_impl.go -------------------------------------------------------------------------------- /test.http: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/test.http -------------------------------------------------------------------------------- /test/category_controller_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammerZamanNow/belajar-golang-restful-api/HEAD/test/category_controller_test.go --------------------------------------------------------------------------------