mirror of
https://github.com/vlang/v.git
synced 2025-09-14 23:12:33 +03:00
fmt: fix alignment of struct init fields (#22025)
This commit is contained in:
parent
99da5726db
commit
c51d30bf53
671 changed files with 18817 additions and 18787 deletions
|
@ -5,7 +5,7 @@ import os { join_path }
|
|||
fn (mut c Create) set_web_project_files() {
|
||||
base := if c.new_dir { c.name } else { '' }
|
||||
c.files << ProjectFiles{
|
||||
path: join_path(base, 'src', 'databases', 'config_databases_sqlite.v')
|
||||
path: join_path(base, 'src', 'databases', 'config_databases_sqlite.v')
|
||||
content: "module databases
|
||||
|
||||
import db.sqlite // can change to 'db.mysql', 'db.pg'
|
||||
|
@ -17,7 +17,7 @@ pub fn create_db_connection() !sqlite.DB {
|
|||
"
|
||||
}
|
||||
c.files << ProjectFiles{
|
||||
path: join_path(base, 'src', 'templates', 'header_component.html')
|
||||
path: join_path(base, 'src', 'templates', 'header_component.html')
|
||||
content: "<nav>
|
||||
<div class='nav-wrapper'>
|
||||
<a href='javascript:window.history.back();' class='left'>
|
||||
|
@ -36,7 +36,7 @@ pub fn create_db_connection() !sqlite.DB {
|
|||
"
|
||||
}
|
||||
c.files << ProjectFiles{
|
||||
path: join_path(base, 'src', 'templates', 'products.css')
|
||||
path: join_path(base, 'src', 'templates', 'products.css')
|
||||
content: 'h1.title {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
color: #3b7bbf;
|
||||
|
@ -50,7 +50,7 @@ div.products-table {
|
|||
}'
|
||||
}
|
||||
c.files << ProjectFiles{
|
||||
path: join_path(base, 'src', 'templates', 'products.html')
|
||||
path: join_path(base, 'src', 'templates', 'products.html')
|
||||
content: "<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
@ -147,7 +147,7 @@ div.products-table {
|
|||
</html>"
|
||||
}
|
||||
c.files << ProjectFiles{
|
||||
path: join_path(base, 'src', 'auth_controllers.v')
|
||||
path: join_path(base, 'src', 'auth_controllers.v')
|
||||
content: "module main
|
||||
|
||||
import vweb
|
||||
|
@ -164,7 +164,7 @@ pub fn (mut app App) controller_auth(username string, password string) vweb.Resu
|
|||
"
|
||||
}
|
||||
c.files << ProjectFiles{
|
||||
path: join_path(base, 'src', 'auth_dto.v')
|
||||
path: join_path(base, 'src', 'auth_dto.v')
|
||||
content: 'module main
|
||||
|
||||
struct AuthRequestDto {
|
||||
|
@ -174,7 +174,7 @@ struct AuthRequestDto {
|
|||
'
|
||||
}
|
||||
c.files << ProjectFiles{
|
||||
path: join_path(base, 'src', 'auth_services.v')
|
||||
path: join_path(base, 'src', 'auth_services.v')
|
||||
content: "module main
|
||||
|
||||
import crypto.hmac
|
||||
|
@ -269,7 +269,7 @@ fn auth_verify(token string) bool {
|
|||
"
|
||||
}
|
||||
c.files << ProjectFiles{
|
||||
path: join_path(base, 'src', 'index.html')
|
||||
path: join_path(base, 'src', 'index.html')
|
||||
content: "<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
@ -348,7 +348,7 @@ fn auth_verify(token string) bool {
|
|||
"
|
||||
}
|
||||
c.files << ProjectFiles{
|
||||
path: join_path(base, 'src', 'main.v')
|
||||
path: join_path(base, 'src', 'main.v')
|
||||
content: "module main
|
||||
|
||||
import vweb
|
||||
|
@ -391,7 +391,7 @@ pub fn (mut app App) index() vweb.Result {
|
|||
"
|
||||
}
|
||||
c.files << ProjectFiles{
|
||||
path: join_path(base, 'src', 'product_controller.v')
|
||||
path: join_path(base, 'src', 'product_controller.v')
|
||||
content: "module main
|
||||
|
||||
import vweb
|
||||
|
@ -457,7 +457,7 @@ pub fn (mut app App) controller_create_product(product_name string) vweb.Result
|
|||
"
|
||||
}
|
||||
c.files << ProjectFiles{
|
||||
path: join_path(base, 'src', 'product_entities.v')
|
||||
path: join_path(base, 'src', 'product_entities.v')
|
||||
content: "module main
|
||||
|
||||
@[table: 'products']
|
||||
|
@ -470,7 +470,7 @@ struct Product {
|
|||
"
|
||||
}
|
||||
c.files << ProjectFiles{
|
||||
path: join_path(base, 'src', 'product_service.v')
|
||||
path: join_path(base, 'src', 'product_service.v')
|
||||
content: "module main
|
||||
|
||||
import databases
|
||||
|
@ -517,7 +517,7 @@ fn (mut app App) service_get_all_products_from(user_id int) ![]Product {
|
|||
"
|
||||
}
|
||||
c.files << ProjectFiles{
|
||||
path: join_path(base, 'src', 'product_view_api.v')
|
||||
path: join_path(base, 'src', 'product_view_api.v')
|
||||
content: "module main
|
||||
|
||||
import json
|
||||
|
@ -556,7 +556,7 @@ pub fn get_product(token string) ![]User {
|
|||
"
|
||||
}
|
||||
c.files << ProjectFiles{
|
||||
path: join_path(base, 'src', 'product_view.v')
|
||||
path: join_path(base, 'src', 'product_view.v')
|
||||
content: "module main
|
||||
|
||||
import vweb
|
||||
|
@ -578,7 +578,7 @@ pub fn (mut app App) products() !vweb.Result {
|
|||
"
|
||||
}
|
||||
c.files << ProjectFiles{
|
||||
path: join_path(base, 'src', 'user_controllers.v')
|
||||
path: join_path(base, 'src', 'user_controllers.v')
|
||||
content: "module main
|
||||
|
||||
import vweb
|
||||
|
@ -648,7 +648,7 @@ pub fn (mut app App) controller_create_user(username string, password string) vw
|
|||
"
|
||||
}
|
||||
c.files << ProjectFiles{
|
||||
path: join_path(base, 'src', 'user_entities.v')
|
||||
path: join_path(base, 'src', 'user_entities.v')
|
||||
content: "module main
|
||||
|
||||
@[table: 'users']
|
||||
|
@ -663,7 +663,7 @@ mut:
|
|||
"
|
||||
}
|
||||
c.files << ProjectFiles{
|
||||
path: join_path(base, 'src', 'user_services.v')
|
||||
path: join_path(base, 'src', 'user_services.v')
|
||||
content: "module main
|
||||
|
||||
import crypto.bcrypt
|
||||
|
@ -732,7 +732,7 @@ fn (mut app App) service_get_user(id int) !User {
|
|||
"
|
||||
}
|
||||
c.files << ProjectFiles{
|
||||
path: join_path(base, 'src', 'user_view_api.v')
|
||||
path: join_path(base, 'src', 'user_view_api.v')
|
||||
content: "module main
|
||||
|
||||
import json
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue