1. inisialisasi backend golang

This commit is contained in:
sindhu
2024-01-10 16:23:04 +07:00
parent 0464b1629e
commit a2defaaaa8
18 changed files with 6276 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,28 @@
# GraphQL schema example
#
# https://gqlgen.com/getting-started/
type Todo {
id: ID!
text: String!
done: Boolean!
user: User!
}
type User {
id: ID!
name: String!
}
type Query {
todos: [Todo!]!
}
input NewTodo {
text: String!
userId: String!
}
type Mutation {
createTodo(input: NewTodo!): Todo!
}

View File

@@ -0,0 +1,34 @@
# model staff
type Staff {
staff_id: ID!
nip: String!
name: String!
email: String!
phone_number: String
is_active: String
is_login: Boolean
token: String
id_google_sign_in: String!
display_name_google_sign_in: String
created_at: String
last_updated_at: String
}
# model token response ketika login
type TokenResponse {
token: String
message: String
}
# query search
extend type Query {
searchStaffByEmail(email: String!): Staff!
staffGetByStaffId(staff_id: ID!): Staff!
staffListBySearch(search:String, page:Int, maxPerPage: Int): [Staff!]!
}
# mutation untuk perubahan data
extend type Mutation {
generateToken(email: String!, id_google_sign_in:String!): TokenResponse!
loginAttendance(email:String!, id_google_sign_in:String!) : Staff!
}

View File

@@ -0,0 +1,46 @@
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
package model
type Mutation struct {
}
type NewTodo struct {
Text string `json:"text"`
UserID string `json:"userId"`
}
type Query struct {
}
type Staff struct {
StaffID string `json:"staff_id"`
Nip string `json:"nip"`
Name string `json:"name"`
Email string `json:"email"`
PhoneNumber *string `json:"phone_number,omitempty"`
IsActive *string `json:"is_active,omitempty"`
IsLogin *bool `json:"is_login,omitempty"`
Token *string `json:"token,omitempty"`
IDGoogleSignIn string `json:"id_google_sign_in"`
DisplayNameGoogleSignIn *string `json:"display_name_google_sign_in,omitempty"`
CreatedAt *string `json:"created_at,omitempty"`
LastUpdatedAt *string `json:"last_updated_at,omitempty"`
}
type Todo struct {
ID string `json:"id"`
Text string `json:"text"`
Done bool `json:"done"`
User *User `json:"user"`
}
type TokenResponse struct {
Token *string `json:"token,omitempty"`
Message *string `json:"message,omitempty"`
}
type User struct {
ID string `json:"id"`
Name string `json:"name"`
}

View File

@@ -0,0 +1,7 @@
package resolver
// This file will not be regenerated automatically.
//
// It serves as dependency injection for your app, add any dependencies you require here.
type Resolver struct{}

View File

@@ -0,0 +1,32 @@
package resolver
// This file will be automatically regenerated based on the schema, any resolver implementations
// will be copied through when generating and any unknown code will be moved to the end.
// Code generated by github.com/99designs/gqlgen version v0.17.42
import (
"context"
"fmt"
"com.sismedika.com.absensi/graph/generated"
"com.sismedika.com.absensi/graph/model"
)
// CreateTodo is the resolver for the createTodo field.
func (r *mutationResolver) CreateTodo(ctx context.Context, input model.NewTodo) (*model.Todo, error) {
panic(fmt.Errorf("not implemented: CreateTodo - createTodo"))
}
// Todos is the resolver for the todos field.
func (r *queryResolver) Todos(ctx context.Context) ([]*model.Todo, error) {
panic(fmt.Errorf("not implemented: Todos - todos"))
}
// Mutation returns generated.MutationResolver implementation.
func (r *Resolver) Mutation() generated.MutationResolver { return &mutationResolver{r} }
// Query returns generated.QueryResolver implementation.
func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }
type mutationResolver struct{ *Resolver }
type queryResolver struct{ *Resolver }

View File

@@ -0,0 +1,37 @@
package resolver
// This file will be automatically regenerated based on the schema, any resolver implementations
// will be copied through when generating and any unknown code will be moved to the end.
// Code generated by github.com/99designs/gqlgen version v0.17.42
import (
"context"
"fmt"
"com.sismedika.com.absensi/graph/model"
)
// GenerateToken is the resolver for the generateToken field.
func (r *mutationResolver) GenerateToken(ctx context.Context, email string, idGoogleSignIn string) (*model.TokenResponse, error) {
panic(fmt.Errorf("not implemented: GenerateToken - generateToken"))
}
// LoginAttendance is the resolver for the loginAttendance field.
func (r *mutationResolver) LoginAttendance(ctx context.Context, email string, idGoogleSignIn string) (*model.Staff, error) {
panic(fmt.Errorf("not implemented: LoginAttendance - loginAttendance"))
}
// SearchStaffByEmail is the resolver for the searchStaffByEmail field.
func (r *queryResolver) SearchStaffByEmail(ctx context.Context, email string) (*model.Staff, error) {
panic(fmt.Errorf("not implemented: SearchStaffByEmail - searchStaffByEmail"))
}
// StaffGetByStaffID is the resolver for the staffGetByStaffId field.
func (r *queryResolver) StaffGetByStaffID(ctx context.Context, staffID string) (*model.Staff, error) {
panic(fmt.Errorf("not implemented: StaffGetByStaffID - staffGetByStaffId"))
}
// StaffListBySearch is the resolver for the staffListBySearch field.
func (r *queryResolver) StaffListBySearch(ctx context.Context, search *string, page *int, maxPerPage *int) ([]*model.Staff, error) {
panic(fmt.Errorf("not implemented: StaffListBySearch - staffListBySearch"))
}